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
IDENTITY column with explicit START WITH or INCREMENT BY starts with wrong value [CORE6376] #6615
Comments
Modified by: @mrotteveel |
Modified by: @mrotteveeldescription: When using an identity column with an explicit START WITH clause, it starts with the wrong value: SQL> create database 'localhost:e:/db/fb4/identity_test.fdb' user sysdba password 'masterkey';
===================== expected result is 1. SQL> create table identity_test2 (id bigint generated always as identity (start with 1));
===================== expected result is 1 This is also the case for only INCREMENT BY: SQL> create table identity_test3 (id bigint generated always as identity (increment by 10));
===================== Expected result is 1 This is related to CORE6084. => When using an identity column with an explicit START WITH clause, it starts with the wrong value: SQL> create database 'localhost:e:/db/fb4/identity_test.fdb' user sysdba password 'masterkey';
===================== expected result is 1. SQL> create table identity_test2 (id bigint generated always as identity (start with 1));
===================== expected result is 1 This is also the case for only INCREMENT BY: SQL> create table identity_test3 (id bigint generated always as identity (increment by 10));
===================== Expected result is 1 As I also pointed out in CORE6084, there are additional problems with negative increments: there the first generated value should be 2^63 -1 (for BIGINT), 2^31 -1 (for INTEGER) or 2^15 -1 (for SMALLINT) if the START WITH clause is absent. This is related to CORE6084. |
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 RC 1 [ 10930 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Covered by another test(s) Test Details: See test for CORE6084. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @mrotteveel
Is related to CORE6084
When using an identity column with an explicit START WITH clause, it starts with the wrong value:
SQL> create database 'localhost:e:/db/fb4/identity_test.fdb' user sysdba password 'masterkey';
SQL> create table identity_test (id bigint generated always as identity (start with 1 increment by 10));
SQL> insert into identity_test default values;
SQL> select * from identity_test;
=====================
11
expected result is 1.
SQL> create table identity_test2 (id bigint generated always as identity (start with 1));
SQL> insert into identity_test2 default values;
SQL> select * from identity_test2;
=====================
2
expected result is 1
This is also the case for only INCREMENT BY:
SQL> create table identity_test3 (id bigint generated always as identity (increment by 10));
SQL> insert into identity_test3 default values;
SQL> select * from identity_test3;
=====================
10
Expected result is 1
As I also pointed out in CORE6084, there are additional problems with negative increments: there the first generated value should be 2^63 -1 (for BIGINT), 2^31 -1 (for INTEGER) or 2^15 -1 (for SMALLINT) if the START WITH clause is absent.
This is related to CORE6084.
Commits: 44660f8 4d1ce73 23dc0c6
====== Test Details ======
See test for CORE6084.
The text was updated successfully, but these errors were encountered: