Message `object INDEX "<name>" is in use` appears after trying to recreate 
table with too long index key and prevents from dropping that table or recreate 
it with correct indexed field key length
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4800
                 URL: http://tracker.firebirdsql.org/browse/CORE-4800
             Project: Firebird Core
          Issue Type: Bug
            Reporter: Pavel Zotov


Script (on empty new database, page_size = 4k, fw = ON; result is the same on 
SS/SC/CS):
=====
show version;
show database;

set list on;
set width idx_name 12;
set count on;
set echo on;
create table test(x varchar(1015) constraint test_x_unq unique using index 
test_x_idx1);

show table test;
commit;

recreate table test(x varchar(1016) constraint test_x_unq unique using index 
test_x_idx2);
select rdb$relation_id from rdb$relations where rdb$relation_name = 
upper('test');
select rdb$index_name, rdb$unique_flag, rdb$index_inactive from rdb$indices 
where rdb$index_name starting with upper('test_x_idx');
rollback;

show table test;
commit;

recreate table test(x varchar(1015) constraint test_x_unq unique using index 
test_x_idx3);
rollback;

drop table test; -- !!

=====

Output:
======

ISQL Version: WI-T3.0.0.31840 Firebird 3.0 Beta 2
Server version:
Firebird/Windows/Intel/i386 (access method), version "WI-T3.0.0.31840 Firebird 
3.0 Beta 2"
Firebird/Windows/Intel/i386 (remote server), version "WI-T3.0.0.31840 Firebird 
3.0 Beta 2/tcp (csprog)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-T3.0.0.31840 
Firebird 3.0 Beta 2/tcp (csprog)/P13"
on disk structure version 12.0
Database: localhost/3333:e30
        Owner: SYSDBA                         
PAGE_SIZE 4096
Number of DB pages allocated = 228
Sweep interval = 20000
Forced Writes are ON
Transaction - oldest = 4
Transaction - oldest active = 5
Transaction - oldest snapshot = 5
Transaction - Next = 9
ODS = 12.0
Default Character set: NONE
create table test(x varchar(1015) constraint test_x_unq unique using index 
test_x_idx1);

show table test;
X                               VARCHAR(1015) Nullable 
CONSTRAINT TEST_X_UNQ:
  Unique key (X) uses explicit ascending index TEST_X_IDX1
commit;

recreate table test(x varchar(1016) constraint test_x_unq unique using index 
test_x_idx2);
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-key size exceeds implementation restriction for index "TEST_X_IDX2"
After line 11 in file qq.sql
select rdb$relation_id from rdb$relations where rdb$relation_name = 
upper('test');

RDB$RELATION_ID                 128


Records affected: 1
select rdb$index_name, rdb$unique_flag, rdb$index_inactive from rdb$indices 
where rdb$index_name starting with upper('test_x_idx');

RDB$INDEX_NAME                  TEST_X_IDX1                                     
                                             
RDB$UNIQUE_FLAG                 1
RDB$INDEX_INACTIVE              <null>


Records affected: 1
rollback;

show table test;
X                               VARCHAR(1015) Nullable 
CONSTRAINT TEST_X_UNQ:
  Unique key (X) uses explicit ascending index TEST_X_IDX1
commit;

recreate table test(x varchar(1015) constraint test_x_unq unique using index 
test_x_idx3);
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-object INDEX "TEST_X_IDX1" is in use
After line 19 in file qq.sql
rollback;

drop table test; -- !!
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-object INDEX "TEST_X_IDX1" is in use
After line 22 in file qq.sql


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to