Closed
Description
When we drop a database, we queue up a single job to perform schema changes for all objects in the database instead of having individual objects queue up separate jobs. This list is constructed from a filtered list of objects in the database -- objects that depend on other objects (and therefore would be handled by a cascade deletion) are not present in the list. This results in orphaned namespace/descriptor table entries for objects that are dependent on other objects with the database.
To Reproduce
CREATE TABLE db.foo(a int);
CREATE VIEW db.v as SELECT a FROM db.foo;
DROP DATABASE db CASCADE;
SELECT * FROM system.namespace;
There's orphaned entries for v which shouldn't be there.