Преглед на файлове

fcl-db: tests: add case for SQLite into TryDropIfExists. Fixes bug introduced in rev.29109

git-svn-id: trunk@29170 -
lacak преди 10 години
родител
ревизия
85142e88f0
променени са 1 файла, в които са добавени 4 реда и са изтрити 5 реда
  1. 4 5
      packages/fcl-db/tests/sqldbtoolsunit.pas

+ 4 - 5
packages/fcl-db/tests/sqldbtoolsunit.pas

@@ -652,16 +652,15 @@ begin
         // which leads to the rollback not referring to the right transaction=>SQL error
         // Use SQL92 ISO standard INFORMATION_SCHEMA:
         FConnection.ExecuteDirect(
-          'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_TYPE=''BASE TABLE'' AND TABLE_NAME=''' + ATableName + ''') '+
-          'begin '+
-          'drop table ' + ATableName + ' '+
-          'end');
+          'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_TYPE=''BASE TABLE'' AND TABLE_NAME=''' + ATableName + ''')'+
+          ' drop table ' + ATableName );
         end;
       ssMySQL:
         begin
         FConnection.ExecuteDirect('drop table if exists ' + ATableName);
         end;
-      ssPostgresql:
+      ssPostgreSQL,
+      ssSQLite:
         begin
         FConnection.ExecuteDirect('drop table if exists ' + ATableName);
         FTransaction.CommitRetaining;