Leave out "_binary" keyword on MSSQL when inserting binary files. Fixes issue #3244.

This commit is contained in:
Ansgar Becker
2013-06-22 04:47:17 +00:00
parent 6371ff5557
commit 3eb6e431cc

View File

@ -641,9 +641,12 @@ begin
if Pos('%filecontent%', ColInfo.Value) > 0 then begin
if not FileReadDone then begin
// Import binaries as-is (byte for byte), and auto-detect encoding of text files.
if FileInfo.IsBinary then
FileContent := '_binary 0x' + BinToWideHex(ReadBinaryFile(FileInfo.Filename, 0))
else
if FileInfo.IsBinary then begin
FileContent := '';
if FConnection.Parameters.NetTypeGroup = ngMySQL then
FileContent := '_binary ';
FileContent := FileContent + '0x' + BinToWideHex(ReadBinaryFile(FileInfo.Filename, 0))
end else
FileContent := esc(ReadTextfile(FileInfo.Filename, nil));
FileReadDone := True;
end;