-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: unable to alter column type for a column that has (but actually doesn't have) a constraint #71089
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here. I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Thanks for reporting this, this is rather intriguing. I'll look into this. |
This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes cockroachdb#71089. Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have.
70840: jobs: fix a flakey test by adopting SucceedsSoon r=postamar a=ajwerner The test failed because the operation stopped retrying. The defaults for the retrier were less than the duration of a KV lease. Fixes #70664. Release note: None 70944: roachprod: upgrade Azure Ubuntu image to 20.04 r=jlinder a=rail Previously, currently used Ubuntu 18.04 doesn't support `systemd-run --same-dir`, which is used by some roachprod scripts. Additionally, GCE and AWS already use Ubuntu 20.04 based images for roachprod. Updating the base image to Ubuntu 20.04 fixes the issue above and aligns the version with other cloud providers. Release note: None 71097: sql: fix FK check bug in ALTER COLUMN TYPE r=postamar a=postamar This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes #71089. Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have. Co-authored-by: Andrew Werner <[email protected]> Co-authored-by: Rail Aliiev <[email protected]> Co-authored-by: Marius Posta <[email protected]>
This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes #71089. Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have.
This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes cockroachdb#71089. Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have.
This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes cockroachdb#71089. Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have.
This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes cockroachdb#71089. Release justification: simple fix for blatant correctness bug Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have.
This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes cockroachdb#71089. Release justification: simple fix for blatant correctness bug Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have.
This commit fixes an implementation bug when checking that the table's foreign keys didn't hold a reference to the altered column. Fixes cockroachdb#71089. Release justification: simple fix for blatant correctness bug Release note (bug fix): fixes a bug which caused ALTER COLUMN TYPE statements to fail when they shouldn't have.
Describe the problem
When writing some migrations to swap out unique_rowid() with uuids we ran into a peculiar problem where the following error would be thrown, even though there were absolutely no constraints on the id column:
This error points to #48288, but we don't actually have a constraint pointing to, or on the column in question.
To Reproduce
In a fresh database you have to run the following queries for the 'bug' to occur. This is a minimum working reproduction of the bug:
It will throw the aforementioned error, citing that there are constraints on the primary key column in table b, thus it's not able to drop the primary key constraint. There's no extra constraint on the primary key in table
b
, and we can confirm that with the following query:SHOW CONSTRAINTS FROM b;
Which outputs:
To confirm our theory we can run the following queries (after deleting the previously created
b
anda
tables), which will work without a hitch:Notice that we drop the foreign key constraint in this set of queries, and now it succeeds.
Expected behavior
The expected behaviour would be for CockroachDB to not complain that there's a constraint on table
b
'sid
column, as there is in fact no constraint onb.id
.Environment:
The text was updated successfully, but these errors were encountered: