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

isql ignores explicit constraint name when it's confused with an internal, automatic name. [CORE1465] #1882

Closed
firebird-automations opened this issue Sep 16, 2007 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Claudio Valderrama C. (robocop)

Assigned to: Claudio Valderrama C. (robocop)

Is related to QA187

The following commands in isql cause the following output:

create table test(a int constraint integral unique);
show table test;
A INTEGER Nullable
CONSTRAINT INTEGRAL:
Unique key (A)

Now, doing
isql CONSTRAINT.FDB -x
we get:

CREATE TABLE TEST (A INTEGER,
UNIQUE (A));

Notice the name "INTEGRAL" should be included in the definition because it was a user-defined, explicit name. However, isql (since it does the wrong internal logic) confuses it with the INTEG_* implicit constraint names and ignores it. Therefore, reconstructing the db from the script causes the creation of a constraint with an internal name and the loss of the original name.

Commits: e256254

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

The correct output is:

/* Table: TEST, Owner: ATENEA\ADMINISTRATOR */
CREATE TABLE TEST (A INTEGER,
CONSTRAINT INTEGRAL UNIQUE (A));

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

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

resolution: Fixed [ 1 ]

Fix Version: 2.1 Beta 2 [ 10190 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA187 [ QA187 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 13062 ] => Firebird [ 13944 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Following script (running on new empty database) shows that there are still problems in displaying constraints and indices with 'internal' FB-names:

SQL> recreate table test(
CON> x int, y int,
CON> constraint integ_1 unique(x) using index integ_1,
CON> constraint test_y_unq unique(y) using index test_y_idx);

SQL> show table test;
X INTEGER Nullable
Y INTEGER Nullable
CONSTRAINT INTEG_1:
Unique key (X) -------------------------------------------------------------------------------- [ 1 ]
CONSTRAINT TEST_Y_UNQ:
Unique key (Y) uses explicit ascending index TEST_Y_IDX
SQL> exit;

C:\FBTESTING\qa\fbt-repo\tmp>C:\1INSTALL\FIREBIRD\fb25sC\bin\isql.exe -x localhost/3333:e30

SET SQL DIALECT 3;

/* CREATE DATABASE 'localhost/3333:e30' PAGE_SIZE 4096 DEFAULT CHARACTER SET NONE */

/* Table: TEST, Owner: SYSDBA */
CREATE TABLE TEST (X INTEGER,
Y INTEGER,
UNIQUE (X), ------------------------------------------------------------------------------------ [ 2 ]
CONSTRAINT TEST_Y_UNQ UNIQUE (Y) USING INDEX TEST_Y_IDX);

[ 1 ]: no index name in the output of SHOW command;
[ 2 ]: neither constraint nor index name in the output of ISQL -X.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment