mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:09:20 +02:00
fcl-db: tests: add case for SQLite into TryDropIfExists. Fixes bug introduced in rev.29109
git-svn-id: trunk@29170 -
This commit is contained in:
parent
c41bc63cd4
commit
85142e88f0
@ -652,16 +652,15 @@ begin
|
|||||||
// which leads to the rollback not referring to the right transaction=>SQL error
|
// which leads to the rollback not referring to the right transaction=>SQL error
|
||||||
// Use SQL92 ISO standard INFORMATION_SCHEMA:
|
// Use SQL92 ISO standard INFORMATION_SCHEMA:
|
||||||
FConnection.ExecuteDirect(
|
FConnection.ExecuteDirect(
|
||||||
'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_TYPE=''BASE TABLE'' AND TABLE_NAME=''' + ATableName + ''') '+
|
'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_TYPE=''BASE TABLE'' AND TABLE_NAME=''' + ATableName + ''')'+
|
||||||
'begin '+
|
' drop table ' + ATableName );
|
||||||
'drop table ' + ATableName + ' '+
|
|
||||||
'end');
|
|
||||||
end;
|
end;
|
||||||
ssMySQL:
|
ssMySQL:
|
||||||
begin
|
begin
|
||||||
FConnection.ExecuteDirect('drop table if exists ' + ATableName);
|
FConnection.ExecuteDirect('drop table if exists ' + ATableName);
|
||||||
end;
|
end;
|
||||||
ssPostgresql:
|
ssPostgreSQL,
|
||||||
|
ssSQLite:
|
||||||
begin
|
begin
|
||||||
FConnection.ExecuteDirect('drop table if exists ' + ATableName);
|
FConnection.ExecuteDirect('drop table if exists ' + ATableName);
|
||||||
FTransaction.CommitRetaining;
|
FTransaction.CommitRetaining;
|
||||||
|
Loading…
Reference in New Issue
Block a user