Permalink
Browse files

fixed TQueryValue.AsVariant problem under FPC on empty string

  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Jan 7, 2019
1 parent bd3ba1a commit b83b46c7320c9fd655223e3d19a1d701536e1c9b
Showing with 8 additions and 5 deletions.
  1. +7 −4 SynDB.pas
  2. +1 −1 SynopseCommit.inc
@@ -6837,21 +6837,24 @@ function TSQLDBStatement.ColumnToVariant(Col: integer; var Value: Variant): TSQL
if V.VText=pointer(tmp) then
V.VBlobLen := length(tmp) else
V.VBlobLen := StrLen(V.VText);
end;
{$ifndef UNICODE}
if (fConnection<>nil) and not fConnection.Properties.VariantStringAsWideString then begin
VType := varString;
CurrentAnsiConvert.UTF8BufferToAnsi(V.VText,V.VBlobLen,RawByteString(VAny));
if (CurrentAnsiConvert.CodePage=CP_UTF8) and (V.VText=pointer(tmp)) then
RawByteString(VAny) := tmp else
CurrentAnsiConvert.UTF8BufferToAnsi(V.VText,V.VBlobLen,RawByteString(VAny));
end else
{$endif}
{$endif UNICODE}
UTF8ToSynUnicode(V.VText,V.VBlobLen,SynUnicode(VAny));
end else
VType := varString; // avoid obscure "Invalid variant type" in FPC
end;
else raise ESQLDBException.CreateUTF8(
'%.ColumnToVariant: Invalid ColumnType(%)=%',[self,Col,ord(result)]);
end;
end;
end;
{$endif}
{$endif LVCL}

function TSQLDBStatement.ColumnTimestamp(Col: integer): TTimeLog;
begin
@@ -1 +1 @@
'1.18.4944'
'1.18.4945'

0 comments on commit b83b46c

Please sign in to comment.