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

recreate table T with PK or UK is impossible after duplicate typing w/o commit when ISQL is launched in AUTODDL=OFF mode [CORE3529] #3886

Closed
firebird-automations opened this issue Jun 18, 2011 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

The following scenario will brings up some strange state of metadata: table T would not be able neither to recreate again nor to be dropped.

C:\FIREBIRD\Data>isql -n
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 'test5.fdb' pagesize 4096; commit;
SQL> connect test5.fdb user sysdba password masterkey;
Database: test5.fdb, User: sysdba
SQL> recreate table t(id int primary key); -- accidentally forgot to place COMMIT here and recall prev. command
SQL> recreate table t(id int primary key); commit; -- accidentally forgot to delete previous 'recreate' command
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-too few key columns found for index RDB$PRIMARY1 (incorrect column name?)
SQL> commit; -- since that point the problem persists until b/r will be done
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-too few key columns found for index RDB$PRIMARY1 (incorrect column name?)
SQL> exit;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-too few key columns found for index RDB$PRIMARY1 (incorrect column name?)

C:\FIREBIRD\Data>isql TEST5.FDB -- now launch ISQL *without* switch '-N' but the problem remains
Database: TEST5.FDB
SQL> commit; recreate table t(id int primary key); commit;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-cannot create index RDB$PRIMARY3
SQL> exit;

@firebird-automations
Copy link
Collaborator Author

Commented by: GR (gr)

It isn't related to ISQL, it is core engine bug.
So the ticket title should be changed like
"trouble with double recreation table
with PK in the same transaction".

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Component: Engine [ 10000 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Confirmed for 2.5.Release branch

ilya071294 added a commit to red-soft-ru/firebird that referenced this issue Oct 19, 2021
… raises when attempt to create table with PK and immediatelly drop this PK within the same transaction

This commit also fixes FirebirdSQL#5173 and FirebirdSQL#3886.
The situation when the record is not found in RDB$INDICES was not handled correctly in create_index DFW.
ilya071294 added a commit to red-soft-ru/firebird that referenced this issue Oct 20, 2021
… raises when attempt to create table with PK and immediatelly drop this PK within the same transaction

This commit also fixes FirebirdSQL#5173 and FirebirdSQL#3886.
The situation when the record is not found in RDB$INDICES was not handled correctly in create_index DFW.
ilya071294 added a commit to red-soft-ru/firebird that referenced this issue Oct 20, 2021
… raises when attempt to create table with PK and immediatelly drop this PK within the same transaction

This commit also fixes FirebirdSQL#5173 and FirebirdSQL#3886.
The situation when the record is not found in RDB$INDICES was not handled correctly in create_index DFW.
@dyemanov dyemanov closed this as completed Nov 8, 2021
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

3 participants