Issue #3003: Add support for microseconds in some temporal datatypes of MariaDB 5.3+ and MySQL 5.6, at least in the table editor. TODO: Support that in data grid editor too.

This commit is contained in:
Ansgar Becker
2012-12-15 06:56:44 +00:00
parent 4662ebf31e
commit dffae1b4af

View File

@@ -1385,7 +1385,7 @@ end;
procedure TMySQLConnection.DoAfterConnect;
var
TZI: TTimeZoneInformation;
Minutes, Hours: Integer;
Minutes, Hours, i: Integer;
Offset: String;
begin
inherited;
@@ -1413,6 +1413,16 @@ begin
Offset := Offset + Format('%.2d:%.2d', [Abs(Hours), Abs(Minutes)]);
Query('SET time_zone='+EscapeString(Offset));
end;
// Support microseconds in some temporal datatypes of MariaDB 5.3+ and MySQL 5.6
if ((ServerVersionInt >= 50300) and Parameters.IsMariaDB) or
((ServerVersionInt >= 50604) and (not Parameters.IsMariaDB)) then begin
for i:=Low(FDatatypes) to High(FDatatypes) do begin
if FDatatypes[i].Index in [dtDatetime, dtTime, dtTimestamp] then
FDatatypes[i].HasLength := True;
end;
end;
end;