I think this is not a bug and by design from the beginning. If metadef_resource_types are not associated with any namespaces then they will remain in metadef_resource_types table forever.
If any resource type is associated with metadef_namespaces then new entry will be added in 'metadef_namespace_resource_types' and while de-associating it will delete the resource type from that table but keeps it in metadef_resource_types table so that if anyone wants to use that in future then that can be associated to with same or different namespace.
Same thing goes with deleting the namespace without de-associating resource-types, it will clear/delete reource-types from metadef_namespace_resource_types table but will keep it in metadef_resource_types table.
If we want to delete the resource type from the metadef_resource_types on deassociation and deleting the namespace as well then I think that will be API behavior change and requires a spec for further discussion.
I think this is not a bug and by design from the beginning. If metadef_ resource_ types are not associated with any namespaces then they will remain in metadef_ resource_ types table forever.
If any resource type is associated with metadef_namespaces then new entry will be added in 'metadef_ namespace_ resource_ types' and while de-associating it will delete the resource type from that table but keeps it in metadef_ resource_ types table so that if anyone wants to use that in future then that can be associated to with same or different namespace.
Same thing goes with deleting the namespace without de-associating resource-types, it will clear/delete reource-types from metadef_ namespace_ resource_ types table but will keep it in metadef_ resource_ types table.
If we want to delete the resource type from the metadef_ resource_ types on deassociation and deleting the namespace as well then I think that will be API behavior change and requires a spec for further discussion.