Browse Source

pqconnection: support ftVarBytes parameters (TParam.SetAsBytes)

git-svn-id: trunk@49010 -
ondrej 4 years ago
parent
commit
72fc981c7f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/fcl-db/src/sqldb/postgres/pqconnection.pp

+ 4 - 4
packages/fcl-db/src/sqldb/postgres/pqconnection.pp

@@ -845,7 +845,7 @@ const TypeStrings : array[TFieldType] of string =
       'time',      // ftTime
       'time',      // ftTime
       'timestamp', // ftDateTime
       'timestamp', // ftDateTime
       'Unknown',   // ftBytes
       'Unknown',   // ftBytes
-      'Unknown',   // ftVarBytes
+      'bytea',     // ftVarBytes
       'Unknown',   // ftAutoInc
       'Unknown',   // ftAutoInc
       'bytea',     // ftBlob 
       'bytea',     // ftBlob 
       'text',      // ftMemo
       'text',      // ftMemo
@@ -1041,7 +1041,7 @@ begin
               end;
               end;
             ftFmtBCD:
             ftFmtBCD:
               s := BCDToStr(AParams[i].AsFMTBCD, FSQLFormatSettings);
               s := BCDToStr(AParams[i].AsFMTBCD, FSQLFormatSettings);
-            ftBlob, ftGraphic:
+            ftBlob, ftGraphic, ftVarBytes:
               begin
               begin
               Handled:=true;
               Handled:=true;
               bd:= AParams[i].AsBlob;
               bd:= AParams[i].AsBlob;
@@ -1064,7 +1064,7 @@ begin
             StrMove(PAnsiChar(ar[i]), PAnsiChar(s), L+1);
             StrMove(PAnsiChar(ar[i]), PAnsiChar(s), L+1);
             lengths[i]:=L;
             lengths[i]:=L;
             end;
             end;
-          if (AParams[i].DataType in [ftBlob,ftMemo,ftGraphic,ftCurrency]) then
+          if (AParams[i].DataType in [ftBlob,ftMemo,ftGraphic,ftCurrency,ftVarBytes]) then
             Formats[i]:=1
             Formats[i]:=1
           else
           else
             Formats[i]:=0;  
             Formats[i]:=0;  
@@ -1338,7 +1338,7 @@ begin
           end;
           end;
           pchar(Buffer + li)^ := #0;
           pchar(Buffer + li)^ := #0;
           end;
           end;
-        ftBlob, ftMemo :
+        ftBlob, ftMemo, ftVarBytes :
           CreateBlob := True;
           CreateBlob := True;
         ftDate :
         ftDate :
           begin
           begin