Browse Source

fcl-db: sqldb: add support for backtick "`" as identifier delimiter.

git-svn-id: trunk@26152 -
lacak 11 years ago
parent
commit
b6005af745
2 changed files with 5 additions and 9 deletions
  1. 4 8
      packages/fcl-db/src/base/dsparams.inc
  2. 1 1
      packages/fcl-db/src/sqldb/sqldb.pp

+ 4 - 8
packages/fcl-db/src/base/dsparams.inc

@@ -192,16 +192,12 @@ end;
 function SkipComments(var p: PChar; EscapeSlash, EscapeRepeat : Boolean) : Boolean;
 function SkipComments(var p: PChar; EscapeSlash, EscapeRepeat : Boolean) : Boolean;
 
 
 begin
 begin
-  result := false;
+  Result := False;
   case p^ of
   case p^ of
-    '''':
+    '''', '"', '`':
       begin
       begin
-        SkipQuotesString(p,'''',EscapeSlash,EscapeRepeat); // single quote delimited string
-        Result := True;
-      end;
-    '"':
-      begin
-        SkipQuotesString(p,'"',EscapeSlash,EscapeRepeat);  // double quote delimited string
+        // single quote, double quote or backtick delimited string
+        SkipQuotesString(p, p^, EscapeSlash, EscapeRepeat);
         Result := True;
         Result := True;
       end;
       end;
     '-': // possible start of -- comment
     '-': // possible start of -- comment

+ 1 - 1
packages/fcl-db/src/sqldb/sqldb.pp

@@ -1747,7 +1747,7 @@ begin
         until (CurrentP^ = #0) or (BracketCount = 0);
         until (CurrentP^ = #0) or (BracketCount = 0);
         if CurrentP^ <> #0 then inc(CurrentP);
         if CurrentP^ <> #0 then inc(CurrentP);
         end;
         end;
-      '"':
+      '"','`':
         if SkipComments(CurrentP, sqEscapeSlash in ConnOptions, sqEscapeRepeat in ConnOptions) then
         if SkipComments(CurrentP, sqEscapeSlash in ConnOptions, sqEscapeRepeat in ConnOptions) then
           Separator := sepDoubleQuote;
           Separator := sepDoubleQuote;
       else
       else