Add support for MariaDB's new UUID column type. Closes #1545

This commit is contained in:
Ansgar Becker
2022-06-28 20:42:14 +02:00
parent 470d692b6d
commit c992656aab
2 changed files with 19 additions and 4 deletions

View File

@@ -7887,13 +7887,13 @@ begin
IsBinary := Field.charsetnr = COLLATION_BINARY
else
IsBinary := (Field.flags and BINARY_FLAG) = BINARY_FLAG;
if IsBinary and (FConnection.Datatypes[j].Index in [dbdtChar..dbdtLongtext]) then
if IsBinary and (FConnection.Datatypes[j].Category = dtcText) then
continue;
FColumnTypes[i] := FConnection.Datatypes[j];
break;
Break;
end;
end;
FConnection.Log(lcDebug, 'Detected column type for '+FColumnNames[i]+': '+FColumnTypes[i].Name);
FConnection.Log(lcDebug, 'Detected column type for '+FColumnNames[i]+' ('+IntToStr(Field._type)+'): '+FColumnTypes[i].Name);
end;
FRecNo := -1;
First;

View File

@@ -370,7 +370,7 @@ var
// MySQL Data Type List and Properties
MySQLDatatypes: array [0..37] of TDBDatatype =
MySQLDatatypes: array [0..38] of TDBDatatype =
(
(
Index: dbdtUnknown;
@@ -734,6 +734,21 @@ var
LoadPart: False;
Category: dtcText;
),
(
Index: dbdtUniqueidentifier;
NativeType: 254;
Name: 'UUID';
Description: 'UUID' + sLineBreak +
'The UUID data type is intended for the storage of 128-bit UUID (Universally ' +
'Unique Identifier) data. See the UUID function page for more details on UUIDs ' +
'themselves.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcText;
),
(
Index: dbdtBinary;
NativeType: 254;