mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 12:29:25 +02:00
* fix retrieving AutoInc value when index of autoinc field differs in Fields and in fielddefs
git-svn-id: trunk@19247 -
This commit is contained in:
parent
4c21beb48e
commit
e10071da70
@ -278,7 +278,7 @@ var
|
||||
begin
|
||||
//Get AutoInc Field initial value
|
||||
if FAutoIncFieldNo <> -1 then
|
||||
sqlite3_exec(FSqliteHandle, PChar('Select Max(' + Fields[FAutoIncFieldNo].FieldName +
|
||||
sqlite3_exec(FSqliteHandle, PChar('Select Max(' + FieldDefs[FAutoIncFieldNo].Name +
|
||||
') from ' + FTableName), @GetAutoIncValue, @FNextAutoInc, nil);
|
||||
|
||||
FReturnCode := sqlite3_prepare(FSqliteHandle, PChar(FEffectiveSQL), -1, @vm, nil);
|
||||
|
@ -228,7 +228,7 @@ var
|
||||
begin
|
||||
//Get AutoInc Field initial value
|
||||
if FAutoIncFieldNo <> -1 then
|
||||
sqlite_exec(FSqliteHandle, PChar('Select Max(' + Fields[FAutoIncFieldNo].FieldName + ') from ' + FTableName),
|
||||
sqlite_exec(FSqliteHandle, PChar('Select Max(' + FieldDefs[FAutoIncFieldNo].Name + ') from ' + FTableName),
|
||||
@GetAutoIncValue, @FNextAutoInc, nil);
|
||||
|
||||
FReturnCode := sqlite_compile(FSqliteHandle, PChar(FEffectiveSQL), nil, @vm, nil);
|
||||
|
Loading…
Reference in New Issue
Block a user