Firebird 6 bug? Alter Table T1 Alter Column F1 Restart With 2;

36 views
Skip to first unread message

Valdir Marcos

unread,
Jun 7, 2026, 1:22:57 AM (8 days ago) Jun 7
to firebird-devel
I am testing Firebird-6.0.0.1941-eec431b-linux-x64.

Create Table T1(
  F1 Integer Generated By Default As Identity Primary Key,
  F2 VarChar(1));
Insert Into T1(F2) Values (   'A');
Insert Into T1     Values (2, 'B');
Insert Into T1(F2) Values (   'C');  <-- expected error
Commit;

Alter Table T1 Alter Column F1 Restart With 2;  <-- bug?
Commit;



isql:
SQL> Create Table T1(
CON>   F1 Integer Generated By Default As Identity Primary Key,
CON>   F2 VarChar(1));
SQL> Insert Into T1(F2) Values (   'A');
SQL> Insert Into T1     Values (2, 'B');
SQL> Insert Into T1(F2) Values (   'C');
Statement failed, SQLSTATE = 23000
violation of PRIMARY or UNIQUE KEY constraint "INTEG_848" on table "PUBLIC"."T1"
-Problematic key value is ("F1" = 2)
SQL>
SQL> Alter Table T1 Alter Column F1 Restart With 2;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-ALTER TABLE "PUBLIC"."T1" failed
-Cannot delete index used by an Integrity Constraint
SQL> Commit;
SQL>
SQL> Alter Table T1 Alter Column F1 Restart With 3;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-ALTER TABLE "PUBLIC"."T1" failed
-Cannot delete index used by an Integrity Constraint
SQL>

Mark Rotteveel

unread,
Jun 7, 2026, 7:14:11 AM (8 days ago) Jun 7
to firebir...@googlegroups.com
On 07-06-2026 01:03, Valdir Marcos wrote:
> I am testing Firebird-6.0.0.1941-eec431b-linux-x64.

Please try with a more recent build (current build is 6.0.0.1999).
According to https://github.com/FirebirdSQL/firebird/issues/9001, this
was fixed three weeks ago.

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Jun 7, 2026, 7:17:17 AM (8 days ago) Jun 7
to firebir...@googlegroups.com
Specifically, it should be fixed in build 6.0.0.1952 or higher.

Mark
--
Mark Rotteveel

Valdir Marcos

unread,
Jun 7, 2026, 11:42:40 PM (7 days ago) Jun 7
to firebird-devel
I have installed latest Firebird-6.0.0.1999-c8bc46b-linux-x64.

Now, I can't even connect:

SQL> connect localhost:xyz;
Statement failed, SQLSTATE = XX000
internal Firebird consistency check (wrong record length (183), file: vio.cpp line: 1902)
SQL>

Alex Peshkoff

unread,
Jun 8, 2026, 1:14:08 AM (7 days ago) Jun 8
to firebir...@googlegroups.com
On 6/8/26 06:42, Valdir Marcos wrote:
> I have installed latest Firebird-6.0.0.1999-c8bc46b-linux-x64.
>
> Now, I can't even connect:
>
> SQL> connect localhost:xyz;
> Statement failed, SQLSTATE = XX000
> internal Firebird consistency check (wrong record length (183), file:
> vio.cpp line: 1902)

FB6 is pre-alpha state and ODS changes take place. One of them is a
cause of an error and it's normal behavior at current stage. You should
remove all FB6 databases and begin from the beginning with your tests.


Pavel Zotov

unread,
Jun 8, 2026, 5:33:53 AM (7 days ago) Jun 8
to firebird-devel
On 6.0.0.1999-c8bc46b:
===================
set bail OFF;
set list on;
set autoterm on;
set keep_tran on;
shell if exist r:\temp\tmp4test.fdb del r:\temp\tmp4test.fdb;
create database 'localhost:r:\temp\tmp4test.fdb' user 'sysdba' password 'masterkey';
Server version:
WI-T6.0.0.1999 Firebird 6.0 Initial
WI-T6.0.0.1999 Firebird 6.0 Initial/tcp (PZ)/P20:C
WI-T6.0.0.1999 Firebird 6.0 Initial/tcp (PZ)/P20:C

create table t1(
    f1 integer generated by default as identity primary key,
    f2 varchar(1)
);

insert into t1(f2) values (   'a');
insert into t1     values (2, 'b');
insert into t1(f2) values (   'c');

Statement failed, SQLSTATE = 23000
violation of PRIMARY or UNIQUE KEY constraint "INTEG_1" on table "PUBLIC"."T1"

-Problematic key value is ("F1" = 2)
After line 15 in file fbdevel-iCJ8NHTD_E8.sql
commit;

alter table t1 alter column f1 restart with 2;
commit;
===================

Alex Peshkoff

unread,
Jun 8, 2026, 6:02:21 AM (7 days ago) Jun 8
to firebir...@googlegroups.com
On 6/8/26 12:33, Pavel Zotov wrote:

create table t1(
    f1 integer generated by default as identity primary key,
    f2 varchar(1)
);

insert into t1(f2) values (   'a'); --f1 == 1 /gener
insert into t1     values (2, 'b'); --f1 == 2 /assign
insert into t1(f2) values (   'c'); --f1 == 2 /gener => not unique

Statement failed, SQLSTATE = 23000
violation of PRIMARY or UNIQUE KEY constraint "INTEG_1" on table "PUBLIC"."T1"
-Problematic key value is ("F1" = 2)
After line 15 in file fbdevel-iCJ8NHTD_E8.sql
commit;

alter table t1 alter column f1 restart with 2;
commit;
===================


What is a problem?


Pavel Zotov

unread,
Jun 8, 2026, 6:24:51 AM (7 days ago) Jun 8
to firebird-devel
What is a problem?
As for me - no problem, all expected (i've only wanted to check that there is no "internal Firebird consistency check")
 

Valdir Marcos

unread,
Jun 8, 2026, 8:18:41 AM (6 days ago) Jun 8
to firebird-devel
Done. Thanks.

Valdir Marcos

unread,
Jun 8, 2026, 8:31:59 AM (6 days ago) Jun 8
to firebird-devel
Reply all
Reply to author
Forward
0 new messages