Issue Details (XML | Word | Printable)

Key: CORE-1465
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Claudio Valderrama C.
Reporter: Claudio Valderrama C.
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

isql ignores explicit constraint name when it's confused with an internal, automatic name.

Created: 15/Sep/07 11:29 PM   Updated: Saturday 09:46 PM
Component/s: ISQL
Affects Version/s: 1.0.3, 1.5.2, 1.5.3, 2.0.0, 1.5.4, 2.0.1, 2.1 Alpha 1, 2.1 Beta 1, 2.0.2
Fix Version/s: 2.1 Beta 2

Environment: Independent of operating system.
Issue Links:
Relate
 


 Description  « Hide
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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Claudio Valderrama C. added a comment - 16/Sep/07 04:57 AM
The correct output is:

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

Pavel Zotov added a comment - 23/May/15 09:45 PM - edited
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.