You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong column name in CHECK when trying to modify a table column #1817
Tried to modify a table using the "modify table" button.
Simple example table, renaming is_alpha to is_beta:
CREATE TABLE `test` (
`id` INTEGER NOT NULL,
`is_alpha` BOOLEAN,
CHECK(is_alpha IN (0,1)),
PRIMARY KEY(`id`)
);
What did you expect to see?
The renamed table column as in:
CREATE TABLE `test` (
`id` INTEGER NOT NULL,
`is_beta` BOOLEAN,
CHECK(is_beta IN (0,1)),
PRIMARY KEY(`id`)
);
What did you see instead?
The following error message:
Modifying this column failed. Error returned from database:
Creating new table failed. DB says: no such column: is_alpha (CREATE TABLE "sqlb_temp_table_3" (
"id" INTEGER NOT NULL,
"is_beta" BOOLEAN,
CHECK(is_alpha IN (0,1)),
PRIMARY KEY("id")
);)
Problem appears to be the CHECK(is_alpha IN (0,1)),, which should be CHECK(is_beta IN (0,1)),
Useful extra information
The info below often helps, please fill it out if you're able to. :)
Tried the current nightly after starting this bug report on the "old" bug that the spaces were missing around the IN in the CHECK statement (on 3.10.1 at least).
I have an issue where a space is remove from the CHECK instruction making the modification fail since the function (should be just "in") is now missing. Is this related to this bug or should I open a new issue?
Activity
justinclift commentedon Mar 24, 2019
Thanks @the-holger, this sounds like a bug we should be able to fix. 😄
chrisjlocke commentedon Mar 24, 2019
...in the meanwhilst, if you remove the CHECK constraint, I assume you can rename the column, then put the constaint back?
derdritte commentedon Jun 30, 2019
I have an issue where a space is remove from the CHECK instruction making the modification fail since the function (should be just "in") is now missing. Is this related to this bug or should I open a new issue?