mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 03:01:07 +08:00
Do not write "NULL" string in grid export formats other than SQL INSERTs/REPLACEs. Fixes issue #2733.
This commit is contained in:
@ -577,9 +577,6 @@ begin
|
|||||||
|
|
||||||
case ExportFormat of
|
case ExportFormat of
|
||||||
efHTML: begin
|
efHTML: begin
|
||||||
// Handle nulls.
|
|
||||||
if GridData.IsNull(Col) then
|
|
||||||
Data := TEXT_NULL;
|
|
||||||
// Escape HTML control characters in data.
|
// Escape HTML control characters in data.
|
||||||
Data := htmlentities(Data);
|
Data := htmlentities(Data);
|
||||||
tmp := tmp + ' <td class="col' + IntToStr(Col) + '">' + Data + '</td>' + CRLF;
|
tmp := tmp + ' <td class="col' + IntToStr(Col) + '">' + Data + '</td>' + CRLF;
|
||||||
@ -588,13 +585,7 @@ begin
|
|||||||
efExcel, efCSV, efLaTeX, efWiki: begin
|
efExcel, efCSV, efLaTeX, efWiki: begin
|
||||||
// Escape encloser characters inside data per de-facto CSV.
|
// Escape encloser characters inside data per de-facto CSV.
|
||||||
Data := StringReplace(Data, Encloser, Encloser+Encloser, [rfReplaceAll]);
|
Data := StringReplace(Data, Encloser, Encloser+Encloser, [rfReplaceAll]);
|
||||||
// Special handling for NULL (MySQL-ism, not de-facto CSV: unquote value)
|
Data := Encloser + Data + Encloser;
|
||||||
if GridData.IsNull(Col) then begin
|
|
||||||
Data := 'NULL';
|
|
||||||
if ExportFormat = efWiki then
|
|
||||||
Data := '_'+Data+'_';
|
|
||||||
end else
|
|
||||||
Data := Encloser + Data + Encloser;
|
|
||||||
tmp := tmp + Data + Separator;
|
tmp := tmp + Data + Separator;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user