RDB$INDICES information stored inconsistently after a CREATE INDEX
------------------------------------------------------------------

                 Key: CORE-3741
                 URL: http://tracker.firebirdsql.org/browse/CORE-3741
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.1
            Reporter: Mark Rotteveel
            Priority: Trivial


The information in RDB$INDICES is stored inconsistently for the true/false 
values of 1 and 0 when an index is created using CREATE INDEX.

RDB$UNIQUE_FLAG is 1 for a unique index, but NULL for non-unique (I would 
expect 0)
RDB$INDEX_INACTIVE is NULL for newly created indices (I would expect 0), 
issuing an ALTER INDEX <name> INACTIVE makes it 1 and 0 if it has been again 
altered to ACTIVE
RDB$INDEX_TYPE is 1 for DESCENDING indices, but NULL for ASCENDING (I would 
expect 0)

After a backup and restore, these fields do get the expected values.

Small DDL script that will demonstrate most of this:
CREATE TABLE TEST_COLUMN_DEFAULTS
(
  COL_INTEGER_DEFAULT_NULL Integer DEFAULT NULL,
  COL_INTEGER_DEFAULT_999 Integer DEFAULT 999,
  COL_VARCHAR_DEFAULT_NULL Varchar(100) DEFAULT NULL,
  COL_VARCHAR_DEFAULT_USER Varchar(100) DEFAULT USER,
  COL_VARCHAR_DEFAULT_LITERAL Varchar(100) DEFAULT 'literal'
);
CREATE INDEX IDX_COMPUTED ON TEST_COLUMN_DEFAULTS COMPUTED BY 
('!'||COL_VARCHAR_DEFAULT_USER||'!');
CREATE DESCENDING INDEX IDX_COMPUTED2 ON TEST_COLUMN_DEFAULTS COMPUTED BY 
('!'||COL_VARCHAR_DEFAULT_USER||'!');
CREATE DESCENDING INDEX IDX_TEST_COLUMN_DEFAULTS1 ON TEST_COLUMN_DEFAULTS 
(COL_INTEGER_DEFAULT_NULL);
CREATE UNIQUE INDEX IDX_TEST_COLUMN_DEFAULTS2 ON TEST_COLUMN_DEFAULTS 
(COL_INTEGER_DEFAULT_999);

-- 
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

        

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to