Bug in GetIndexInfo
Posted: 04.11.2005, 20:52
The statement PRAGMA index_list(Tablename) returns:
For each index on the named table, one record with information about that index. Arguments include the index name and a flag to indicate whether or not the index must be unique.
Then the code in GetIndexInfo of TDdcSQLiteMetadata is wrong because the value of Unique flag is read inverted.
The problem is in the follow lines
if (Pos(' autoindex ', GetString(2)) = 0)
>> and ((Unique = False) or (GetInt(3) <> 0)) then
and
>> Result.UpdateBoolean(4, GetInt(3) <> 0);
They would have to be replaced by
if (Pos(' autoindex ', GetString(2)) = 0)
>> and ((Unique = False) or (GetInt(3) = 0)) then
and
>> Result.UpdateBoolean(4, GetInt(3) = 0);
Thanks in advance.
Sorry my poor english.
For each index on the named table, one record with information about that index. Arguments include the index name and a flag to indicate whether or not the index must be unique.
Then the code in GetIndexInfo of TDdcSQLiteMetadata is wrong because the value of Unique flag is read inverted.
The problem is in the follow lines
if (Pos(' autoindex ', GetString(2)) = 0)
>> and ((Unique = False) or (GetInt(3) <> 0)) then
and
>> Result.UpdateBoolean(4, GetInt(3) <> 0);
They would have to be replaced by
if (Pos(' autoindex ', GetString(2)) = 0)
>> and ((Unique = False) or (GetInt(3) = 0)) then
and
>> Result.UpdateBoolean(4, GetInt(3) = 0);
Thanks in advance.
Sorry my poor english.