Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DROP TABLE with AUTO_INCREMENT doesn't drop sequence causing left-over dependency #7030

Closed
yzchang opened this issue Dec 16, 2020 · 2 comments
Closed
Labels
bug normal SQL
Milestone

Comments

@yzchang
Copy link
Member

@yzchang yzchang commented Dec 16, 2020

Describe the bug
When a table with an auto_increment column is dropped, the corresponding sequence created for this column is not dropped. This results in at least one left-over dependency of this sequence on the schema to which the table belonged. So the schema can't be dropped.

Also, this implicit sequence can't be dropped with drop sequence seq_nnnn, so there seems to be no way to clean up this.

To Reproduce

create schema s1;
create table s1.t (i int not null auto_increment);
drop table s1.t;
drop schema s1; -- DROP SCHEMA: unable to drop schema 's1' (there are database objects which depend on it)
select sq.id as sequence_id, sq.name as sequence_name, sc.id as schema_id, sc.name as schema_name from sequences sq, schemas sc where sq.schema_id = sc.id; -- shows the left-over dependency

Expected behavior
The auto_increment sequence should have been removed as part of the drop table, and drop schema s1 should succeed.

Software versions

  • MonetDB version number [v11.39.8 (hg id: e6eb722152e3)]
  • OS and version: [e.g. Ubuntu 20.04]
  • Mercurial source
@yzchang yzchang added bug normal SQL labels Dec 16, 2020
@yzchang
Copy link
Member Author

@yzchang yzchang commented Dec 16, 2020

monetdb-team pushed a commit that referenced this issue Dec 16, 2020
@yzchang
Copy link
Member Author

@yzchang yzchang commented Dec 16, 2020

@yzchang yzchang closed this as completed Dec 16, 2020
@njnes njnes added this to the NEXTRELEASE milestone Dec 17, 2020
@sjoerdmullender sjoerdmullender removed this from the NEXTRELEASE milestone Jan 26, 2021
@sjoerdmullender sjoerdmullender added this to the Oct2020-SP2 milestone Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug normal SQL
Projects
None yet
Development

No branches or pull requests

3 participants