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

[CBRD-24544] not allow to alter the column type to a type that does not support auto-increment. #3925

Merged
merged 3 commits into from
Mar 20, 2023

Conversation

beyondykk9
Copy link
Contributor

@beyondykk9 beyondykk9 commented Nov 2, 2022

http://jira.cubrid.org/browse/CBRD-24544

In DB table, the column type can be altered to any DB type, however, if the column has an auto-increment attribute the type altering should be checked severly not to allow non numeric type.

CREATE a_tbl (a int AUTO_INCREMENT, b VARCHAR);
ALTER TABLE a_tbl MODIFY COLUMN a VARCHAR;

The above "ALTER" command must not be allowed because the auto-increment doesn't work properly.

If the auto-increment column type is overflown as altering the type, the ALTER command results error as following message:

ERROR: Start value of an auto increment constraint should be less then max value.

Example:

CREATE TABLE a_tbl (a INT AUTO_INCREMENT (1, 1000000000), b INT);
INSERT INTO a_tbl (b) VALUES (1);
INSERT INTO a_tbl (b) VALUES (2);
ALTER TABLE a_tbl MODIFY COLUMN a SHORT;

ERROR: Start value of an auto increment constraint should be less then max value. 

@beyondykk9 beyondykk9 added this to the fig milestone Nov 2, 2022
@beyondykk9 beyondykk9 self-assigned this Nov 2, 2022
@beyondykk9
Copy link
Contributor Author

The failed Test cases should be modified as changed specification for modifying column type having auto-increment attribute.

@beyondykk9 beyondykk9 changed the title [CBRD-24544] not allow to alter the column type to a type that does not support auto-increment. [CBRD-24454] not allow to alter the column type to a type that does not support auto-increment. Nov 3, 2022
@beyondykk9 beyondykk9 changed the title [CBRD-24454] not allow to alter the column type to a type that does not support auto-increment. [CBRD-24554] not allow to alter the column type to a type that does not support auto-increment. Nov 3, 2022
@beyondykk9 beyondykk9 changed the title [CBRD-24554] not allow to alter the column type to a type that does not support auto-increment. [CBRD-24544] not allow to alter the column type to a type that does not support auto-increment. Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants