PrimaryKey flag is not set correctly in TSQLite3Connection.UpdateIndexDefs
Original Reporter info from Mantis: lacak @lacak.sk
-
Reporter name: LacaK
Original Reporter info from Mantis: lacak @lacak.sk
- Reporter name: LacaK
Description:
In method TSQLite3Connection.UpdateIndexDefs is called protected method getprimarykeyfield() (which uses SQLite3 PRAGMA table_info()), which returns ONLY FIRST column which is marked as PK.
This is poor in case when PK contains more than one column.
Steps to reproduce:
If TSQLQuery.UpdateMode=upWhereKeyOnly and .UsePrimaryKeyAsKey=True then we have problem, because ONLY FIRST column of PK is used to build WHERE clause ...
Additional information:
IMHO this can be fixed in getprimarykeyfield() method:
...<br/>
if (high(ar1[int1]) >= 5) and (ar1[int1][5] <> '0') then
begin
+ if result<>'' then result:=result+';';
+ result:= result + ar1[int1][1];
- result:= ar1[int1][1];
- break;
end;
...
also name of method getprimarykeyfields() would be better ;-)
Mantis conversion info:
- Mantis ID: 16493
- Version: 2.5.1
- Fixed in version: 2.4.4
- Fixed in revision: 16968 (#be828193)
- Target version: 2.5.1