mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 12:51:02 +02:00
fcl-db: sqlite: starting from SQLite 3.7.16, there is changed output of PRAGMA table_info. Now column "pk" shows order of given column in PK (or zero if column is not a part of PK).
Patch keeps backward compatibility. Test TestMultipleFieldPKIndexDefs git-svn-id: trunk@23927 -
This commit is contained in:
parent
8b7071c8e8
commit
81c8825623
@ -885,10 +885,10 @@ begin
|
||||
IXFields:=TStringList.Create;
|
||||
IXFields.Delimiter:=';';
|
||||
|
||||
//primary key fields
|
||||
//primary key fields; 5th column "pk" is zero for columns that are not part of PK
|
||||
artableinfo := stringsquery('PRAGMA table_info('+TableName+');');
|
||||
for ii:=low(artableinfo) to high(artableinfo) do
|
||||
if (high(artableinfo[ii]) >= 5) and (artableinfo[ii][5] = '1') then
|
||||
if (high(artableinfo[ii]) >= 5) and (artableinfo[ii][5] >= '1') then
|
||||
PKFields.Add(artableinfo[ii][1]);
|
||||
|
||||
//list of all table indexes
|
||||
|
Loading…
Reference in New Issue
Block a user