Prechádzať zdrojové kódy

Postgres: do not convert empty TBytes (ftBlob) parameter to NULL

Ondrej Pokorny 2 dní pred
rodič
commit
0394b0a776

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

@@ -1350,13 +1350,11 @@ begin
               Handled:=true;
               bd:= AParams[i].AsBlob;
               l:=length(BD);
+              GetMem(ar[i],l+1);
+              ar[i][l]:=#0;
               if l>0 then
-                begin
-                GetMem(ar[i],l+1);
-                ar[i][l]:=#0;
                 Move(BD[0],ar[i]^, L);
-                lengths[i]:=l;
-                end;
+              lengths[i]:=l;
               end
             else
               s := GetAsString(AParams[i]);