8000 sql: DROP DATABASE CASCADE leaves dependent objects orphaned · Issue #51782 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
sql: DROP DATABASE CASCADE leaves dependent objects orphaned #51782
Closed
@arulajmani

Description

@arulajmani

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.

Metadata

Metadata

Assignees

Labels

A-schema-changesC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0