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