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

Unavailable change domain type for existed field [CORE5539] #5807

Closed
firebird-automations opened this issue May 16, 2017 · 6 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Konstantin Streletsky (streletsky)

my database has the following two domains:

CREATE DOMAIN DM_INTEGER AS
INTEGER;

CREATE DOMAIN DM_VC10 AS
VARCHAR(10) CHARACTER SET WIN1251
COLLATE WIN1251 ;

then I added a new table with column of type DM_INTEGER

CREATE TABLE NEW_TABLE (
TEST_FIELD DM_INTEGER);

but when I tried to change the type of the column

ALTER TABLE NEW_TABLE ALTER COLUMN TEST_FIELD TYPE DM_VC10;

I got an error:

This operation is not defined for system tables.
unsuccessful metadata update.
ALTER TABLE NEW_TABLE failed.
New size specified for column TEST_FIELD must be at least 11 characters.

====== Test Details ======

see test for core-0223

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

The error is entirely valid!

An INTEGER can store a value which as a string can be up to 11 characters in length (*-2147483648* thru 2147483647). As such, the system will not allow you to make a change which could result in data loss.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

description: my database has the following two domains:

CREATE DOMAIN DM_INTEGER AS
INTEGER;

CREATE DOMAIN DM_VC10 AS
VARCHAR(10) CHARACTER SET WIN1251
COLLATE WIN1251 ;

then I added a new table with column of type DM_INTEGER

CREATE TABLE NEW_TABLE (
TEST_FIELD DM_INTEGER);

but when I tried to change the type of the column

ALTER TABLE NEW_TABLE ALTER COLUMN TEST_FIELD TYPE DM_VC10;

I got an error:

This operation is not defined for system tables.
unsuccessful metadata update.
ALTER TABLE NEW_TABLE failed.
New size specified for column TEST_FIELD must be at least 11 characters.

=>

my database has the following two domains:

CREATE DOMAIN DM_INTEGER AS
INTEGER;

CREATE DOMAIN DM_VC10 AS
VARCHAR(10) CHARACTER SET WIN1251
COLLATE WIN1251 ;

then I added a new table with column of type DM_INTEGER

CREATE TABLE NEW_TABLE (
TEST_FIELD DM_INTEGER);

but when I tried to change the type of the column

ALTER TABLE NEW_TABLE ALTER COLUMN TEST_FIELD TYPE DM_VC10;

I got an error:

This operation is not defined for system tables.
unsuccessful metadata update.
ALTER TABLE NEW_TABLE failed.
New size specified for column TEST_FIELD must be at least 11 characters.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Covered by another test(s)

Test Details: see test for core-0223

@firebird-automations
Copy link
Collaborator Author

Commented by: Marius Dinu (marius95)

The error is produced even if the table is empty and and no data loss would result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant