mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 10:02:10 +08:00
Support BIT data type in MS SQL. Fixes issue #2955.
This commit is contained in:
@ -4001,6 +4001,12 @@ begin
|
||||
except
|
||||
Result := String(FCurrentResults.Fields[Column].AsAnsiString);
|
||||
end;
|
||||
if Datatype(Column).Index = dtBit then begin
|
||||
if UpperCase(Result) = 'TRUE' then
|
||||
Result := '1'
|
||||
else
|
||||
Result := '0';
|
||||
end;
|
||||
end;
|
||||
end else if not IgnoreErrors then
|
||||
Raise EDatabaseError.CreateFmt(_(MsgInvalidColumn), [Column, ColumnCount, RecordCount]);
|
||||
@ -4445,7 +4451,7 @@ begin
|
||||
else case Datatype(i).Category of
|
||||
dtcInteger, dtcReal: begin
|
||||
Val := Cell.NewText;
|
||||
if Datatype(i).Index = dtBit then
|
||||
if (Datatype(i).Index = dtBit) and (FConnection.Parameters.NetTypeGroup=ngMySQL) then
|
||||
Val := 'b' + Connection.EscapeString(Val);
|
||||
end;
|
||||
dtcBinary, dtcSpatial:
|
||||
|
@ -812,7 +812,7 @@ var
|
||||
|
||||
);
|
||||
|
||||
MSSQLDatatypes: array [0..25] of TDBDatatype =
|
||||
MSSQLDatatypes: array [0..26] of TDBDatatype =
|
||||
(
|
||||
(
|
||||
Index: dtTinyint;
|
||||
@ -854,6 +854,16 @@ var
|
||||
HasDefault: True;
|
||||
Category: dtcInteger;
|
||||
),
|
||||
(
|
||||
Index: dtBit;
|
||||
Name: 'BIT';
|
||||
Description: '0 or 1';
|
||||
HasLength: False;
|
||||
RequiresLength: False;
|
||||
HasBinary: False;
|
||||
HasDefault: True;
|
||||
Category: dtcInteger;
|
||||
),
|
||||
(
|
||||
Index: dtDecimal;
|
||||
Name: 'DECIMAL';
|
||||
|
Reference in New Issue
Block a user