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

Unable to restore database with tables using GENERATED ALWAYS AS IDENTITY columns (ERROR:OVERRIDING SYSTEM VALUE should be used) [CORE6377] #6616

Closed
firebird-issue-importer opened this issue Aug 1, 2020 · 5 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Aug 1, 2020

Submitted by: @mrotteveel

A database with a column using GENERATED ALWAYS AS IDENTITY cannot be restored by gbak. It looks like the inserts applied by gbak do not specify OVERRIDING SYSTEM VALUE or its equivalent when inserting values:

SQL> create database 'localhost:e:/db/fb4/fb4testdatabase.fdb' user sysdba password 'masterkey' page_size 8192 default character set utf8;
SQL> create table identity_always (id bigint generated always as identity constraint pk_identity_always primary key);
SQL> insert into identity_always default values;
SQL> exit;

gbak -user sysdba -backup e:\db\fb4\FB4TESTDATABASE.FDB e:\db\fb4\fb4testdatabase_20200801.fbk

gbak -user sysdba -replace e:\db\fb4\fb4testdatabase_20200801.fbk e:\db\fb4\FB4TESTDATABASE.FDB
0 blr_version4,
1 blr_begin,
2 blr_message, 0, 2,0,
6 blr_int64, 0,
8 blr_short, 0,
10 blr_loop,
11 blr_receive, 0,
13 blr_store,
14 blr_relation, 15, 'I','D','E','N','T','I','T','Y','_','A','L','W','A','Y','S', 0,
32 blr_begin,
33 blr_assignment,
34 blr_parameter2, 0, 0,0, 1,0,
40 blr_field, 0, 2, 'I','D',
45 blr_end,
46 blr_end,
47 blr_eoc
gbak: ERROR:OVERRIDING SYSTEM VALUE should be used to override the value of an identity column defined as 'GENERATED ALWAYS' in table/view IDENTITY_ALWAYS
gbak: ERROR:gds_$compile_request failed
gbak:Exiting before completion due to errors

Commits: 2e39e4d

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 1, 2020

Modified by: @mrotteveel

description: A database with a column using GENERATED ALWAYS AS IDENTITY cannot be restored by gbak:

SQL> create database 'localhost:e:/db/fb4/fb4testdatabase.fdb' user sysdba password 'masterkey' page_size 8192 default character set utf8;
SQL> create table identity_always (id bigint generated always as identity constraint pk_identity_always primary key);
SQL> insert into identity_always default values;
SQL> exit;

gbak -user sysdba -backup e:\db\fb4\FB4TESTDATABASE.FDB e:\db\fb4\fb4testdatabase_20200801.fbk

gbak -user sysdba -replace e:\db\fb4\fb4testdatabase_20200801.fbk e:\db\fb4\FB4TESTDATABASE.FDB
0 blr_version4,
1 blr_begin,
2 blr_message, 0, 2,0,
6 blr_int64, 0,
8 blr_short, 0,
10 blr_loop,
11 blr_receive, 0,
13 blr_store,
14 blr_relation, 15, 'I','D','E','N','T','I','T','Y','_','A','L','W','A','Y','S', 0,
32 blr_begin,
33 blr_assignment,
34 blr_parameter2, 0, 0,0, 1,0,
40 blr_field, 0, 2, 'I','D',
45 blr_end,
46 blr_end,
47 blr_eoc
gbak: ERROR:OVERRIDING SYSTEM VALUE should be used to override the value of an identity column defined as 'GENERATED ALWAYS' in table/view IDENTITY_ALWAYS
gbak: ERROR:gds_$compile_request failed
gbak:Exiting before completion due to errors

It looks like the inserts applied by gbak do not specify OVERRIDING SYSTEM VALUE or its equivalent when inserting values.

=>

A database with a column using GENERATED ALWAYS AS IDENTITY cannot be restored by gbak. It looks like the inserts applied by gbak do not specify OVERRIDING SYSTEM VALUE or its equivalent when inserting values:

SQL> create database 'localhost:e:/db/fb4/fb4testdatabase.fdb' user sysdba password 'masterkey' page_size 8192 default character set utf8;
SQL> create table identity_always (id bigint generated always as identity constraint pk_identity_always primary key);
SQL> insert into identity_always default values;
SQL> exit;

gbak -user sysdba -backup e:\db\fb4\FB4TESTDATABASE.FDB e:\db\fb4\fb4testdatabase_20200801.fbk

gbak -user sysdba -replace e:\db\fb4\fb4testdatabase_20200801.fbk e:\db\fb4\FB4TESTDATABASE.FDB
0 blr_version4,
1 blr_begin,
2 blr_message, 0, 2,0,
6 blr_int64, 0,
8 blr_short, 0,
10 blr_loop,
11 blr_receive, 0,
13 blr_store,
14 blr_relation, 15, 'I','D','E','N','T','I','T','Y','_','A','L','W','A','Y','S', 0,
32 blr_begin,
33 blr_assignment,
34 blr_parameter2, 0, 0,0, 1,0,
40 blr_field, 0, 2, 'I','D',
45 blr_end,
46 blr_end,
47 blr_eoc
gbak: ERROR:OVERRIDING SYSTEM VALUE should be used to override the value of an identity column defined as 'GENERATED ALWAYS' in table/view IDENTITY_ALWAYS
gbak: ERROR:gds_$compile_request failed
gbak:Exiting before completion due to errors

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 10, 2020

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 11, 2020

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 21, 2020

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 21, 2020

Modified by: @pavel-zotov

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

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

Successfully merging a pull request may close this issue.

None yet
2 participants