From 3eb6e431cc131c6e1566f68df6543213e06a8c07 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 22 Jun 2013 04:47:17 +0000 Subject: [PATCH] Leave out "_binary" keyword on MSSQL when inserting binary files. Fixes issue #3244. --- source/insertfiles.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/insertfiles.pas b/source/insertfiles.pas index d391c7ad..1e4f5f96 100644 --- a/source/insertfiles.pas +++ b/source/insertfiles.pas @@ -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;