Browse Source

* fcl-db: TSQLScript: fix COMMIT RETAIN/COMMIT WORK being mistaken for plain COMMIT because of insertion order.

git-svn-id: trunk@26168 -
reiniero 11 years ago
parent
commit
acd13fdcf9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      packages/fcl-db/src/base/sqlscript.pp

+ 3 - 2
packages/fcl-db/src/base/sqlscript.pp

@@ -549,13 +549,14 @@ procedure TCustomSQLScript.DefaultDirectives;
 begin
 begin
   With FDirectives do
   With FDirectives do
     begin
     begin
+    // Insertion order matters as testing for directives will be done with StartsWith
     if FUseSetTerm then
     if FUseSetTerm then
       Add('SET TERM');
       Add('SET TERM');
     if FUseCommit then
     if FUseCommit then
     begin
     begin
-      Add('COMMIT'); {Shorthand used in many dbs, e.g. Firebird}
-      Add('COMMIT RETAIN'); {Firebird/Interbase; probably won't hurt on other dbs}
       Add('COMMIT WORK'); {SQL Standard, equivalent to commit}
       Add('COMMIT WORK'); {SQL Standard, equivalent to commit}
+      Add('COMMIT RETAIN'); {Firebird/Interbase; probably won't hurt on other dbs}
+      Add('COMMIT'); {Shorthand used in many dbs, e.g. Firebird}
     end;
     end;
     if FUseDefines then
     if FUseDefines then
       begin
       begin