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

Attempt to create table with too long PK leads to bad results [CORE3827] #4169

Open
firebird-automations opened this issue Apr 22, 2012 · 2 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
core_isql.zip

Preface:
ISQL Version: LI-V2.5.2.26448 Firebird 2.5
Server version:
Firebird/linux AMD64 (access method), version "LI-V2.5.2.26448 Firebird 2.5"
on disk structure version 11.2

Test #⁠1.

bash-3.2$ isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'tm.fdb'; commit;
SQL> create table tm(c01 varchar(1024) primary key);
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-key size exceeds implementation restriction for index "RDB$PRIMARY1"

SQL> rollback; -- <<<<<<<<<<<<<<<<<<<<<<<< NB <<<<<<<<<<<<<<<<<<<

SQL> quit;

bash-3.2$ isql tm.fdb;
Database: tm.fdb
SQL> show table;
There are no tables in this database
SQL> show index;
There are no indices in this database
SQL> create table tm(c01 varchar(512) primary key);
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-cannot create index RDB$PRIMARY2

Why table `tm` can not be created ?

Test #⁠2

SQL> create database 'tm.fdb'; commit;
SQL> create table tm(c01 varchar(1024) primary key);
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-key size exceeds implementation restriction for index "RDB$PRIMARY1"

SQL> rollback; -- <<<<<<<<<<<< NB <<<<<<<<<<<<<<

SQL> create table tm(c01 varchar(512) primary key);
SQL> commit;
SQL> create table td(c01 varchar(512) references tm);
Statement failed, SQLSTATE = 08001
I/O error during "read" operation for file "/var/db/firebird/tm.fdb"
-Error while trying to read from file
-Invalid argument
SQL> show database;
Statement failed, SQLSTATE = XX000
internal Firebird consistency check (can't continue after bugcheck)
SQL> quit;

After change setting of Bugcheckabort to 1 I've got coredump and made stacktrace - see attach.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: core_isql.zip [ 12136 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PS. firebird.log contains the following messages for these actions:

fbozzy Sun Apr 22 22:26:00 2012
Database: /var/db/firebird/tm.fdb
I/O error during "read" operation for file "/var/db/firebird/tm.fdb"
Error while trying to read from file
Invalid argument

fbozzy (Client) Sun Apr 22 22:29:40 2012
/opt/firebird/bin/fbguard: /opt/firebird/bin/fb_smp_server normal shutdown.

fbozzy (Client) Sun Apr 22 22:29:41 2012
/opt/firebird/bin/fbguard: guardian starting /opt/firebird/bin/fb_smp_server

fbozzy Sun Apr 22 22:30:39 2012
Database: /var/db/firebird/tm.fdb
internal Firebird consistency check (partner index description not found (175), file: idx.cpp line: 194)

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