
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
windows 2008 and seven, debian, ubuntu desktop oneiric
|
|
Issue Links:
|
Duplicate
|
|
|
|
This issue is duplicated by:
|
|
CORE-3937
DeActivate/Activate INDEX or RESTORE not possible with NULL in unique index.
|
|
|
|
|
Relate
|
|
|
|
This issue is related to:
|
|
|
CORE-2709 Many indexed reads in a compound index with NULLs
|
|
|
|
|
|
|
| Planning Status: |
Unspecified
|
|
The situation is as follows:
A table has an alternate key constraint (unique). The expression of key is composed of four distinct fields of the table. In two rows from the table, the field of order 2 (in the expression of key), has the following "values" (in quotes because is "null" is not value):null and ''(empty) respectively. That is, in the record 'n' the field is set to null, in the record n+1 the same field have the value''(empty). The other values of the other fields components of the alternate key in these records have values equal to each other. As illustrated below:
TABLE1
FIELD_A, FIELD_B, ..., FIELD_1 | FIELD_2 | FIELD_3 | FIELD_4, ..., FIELD_n
-------------------------------------------------- -----------------------------------------------
...
any, any, ..., any | any | any | any, ..., any
any, any, ..., x | null | y | z, ..., any
any, any, ..., x | | y | z, ..., any
any, any, ..., any | any | any | any, ..., any
...
-------------------------------------------------- -----------------------------------------------
('any': any values, different from each other. x, y and z can be any value, but equals in the two rows)
What happens is that when I recover a ".fbk" of this database, gbak can not activate the alternate key index coposed by FIELD_1, FIELD_2, FIELD_3 and FIELD_4, because it believes there may be a violation of the unique key constraint, however, if the TABLE1 does not have any records (no data), gbak, obviously, can recover the database and enable the constraint and, in this situation, I can insert all these records with all these values (that gbak couldn't recover previously), and there's no unique key violation.
This issue has been identified in firebird 2.5.1. We tested the same database in firebird 2.5.0 and this problem did not happen.
|
|
Description
|
The situation is as follows:
A table has an alternate key constraint (unique). The expression of key is composed of four distinct fields of the table. In two rows from the table, the field of order 2 (in the expression of key), has the following "values" (in quotes because is "null" is not value):null and ''(empty) respectively. That is, in the record 'n' the field is set to null, in the record n+1 the same field have the value''(empty). The other values of the other fields components of the alternate key in these records have values equal to each other. As illustrated below:
TABLE1
FIELD_A, FIELD_B, ..., FIELD_1 | FIELD_2 | FIELD_3 | FIELD_4, ..., FIELD_n
-------------------------------------------------- -----------------------------------------------
...
any, any, ..., any | any | any | any, ..., any
any, any, ..., x | null | y | z, ..., any
any, any, ..., x | | y | z, ..., any
any, any, ..., any | any | any | any, ..., any
...
-------------------------------------------------- -----------------------------------------------
('any': any values, different from each other. x, y and z can be any value, but equals in the two rows)
What happens is that when I recover a ".fbk" of this database, gbak can not activate the alternate key index coposed by FIELD_1, FIELD_2, FIELD_3 and FIELD_4, because it believes there may be a violation of the unique key constraint, however, if the TABLE1 does not have any records (no data), gbak, obviously, can recover the database and enable the constraint and, in this situation, I can insert all these records with all these values (that gbak couldn't recover previously), and there's no unique key violation.
This issue has been identified in firebird 2.5.1. We tested the same database in firebird 2.5.0 and this problem did not happen. |
Show » |
|