shaa108 / h2database

Automatically exported from code.google.com/p/h2database
1 stars 0 forks source link

IDENTITY ignored for added column #531

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
IDENTITY with values other than the default (1, 1) works in CREATE TABLE, but 
not when the column is added later.

What steps will reproduce the problem?

Here is a failing test for testSimple.in.txt:

  create table test1 (foo varchar(100));
  alter table test1 add id bigint identity(5, 5) not null;

  insert into test1 values (null, null);
  insert into test1 values (null, null);

  select count(*) from test1 where id=5;
  > 1;
  select count(*) from test1 where id=10;
  > 1;

What is the expected output? What do you see instead?

Expected output is 1 for both selects, instead it is 0. The new IDENTITY column 
has a start value and an increment of 1.

Verified for H2 1.3.173 and revision r5308 from Nov 22 2013. Ubuntu 12.04, Java 
1.7.0_25-b15.

Original issue reported on code.google.com by tkappler@gmail.com on 29 Nov 2013 at 12:22

GoogleCodeExporter commented 8 years ago
Fix committed to SVN.

It will be available in version 1.4.179

Original comment by noelgrandin on 5 May 2014 at 8:14