Skip to content

Commit

Permalink
Support additional UCA collations introduced in MariaDB 10.10.1. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarbecker committed Mar 3, 2024
1 parent b7e7207 commit 7ef74dd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions source/dbconnection.pas
Expand Up @@ -2075,6 +2075,7 @@ constructor TDBConnection.Create(AOwner: TComponent);
FMaxRowsPerInsert := 10000;
FCaseSensitivity := 0;
FStringQuoteChar := '''';
FCollationTable := nil;
end;


Expand Down Expand Up @@ -5328,8 +5329,19 @@ function TDBConnection.GetCollationTable: TDBQuery;
function TMySQLConnection.GetCollationTable: TDBQuery;
begin
inherited;
if (not Assigned(FCollationTable)) and (ServerVersionInt >= 40100) then
FCollationTable := GetResults('SHOW COLLATION');
if (not Assigned(FCollationTable)) and (ServerVersionInt >= 40100) then begin
if Parameters.IsMariaDB and (ServerVersionInt >= 101001) then try
// Issue #1917: MariaDB 10.10.1+ versions have additional collations in IS.COLLATION_CHARACTER_SET_APPLICABILITY
FCollationTable := GetResults('SELECT FULL_COLLATION_NAME AS '+QuoteIdent('Collation')+
' FROM '+QuoteIdent(InfSch)+'.COLLATION_CHARACTER_SET_APPLICABILITY'+
' ORDER BY '+QuoteIdent('Collation')
);
except
on E:EDbError do;
end;
if not Assigned(FCollationTable) then
FCollationTable := GetResults('SHOW COLLATION');
end;
if Assigned(FCollationTable) then
FCollationTable.First;
Result := FCollationTable;
Expand Down

0 comments on commit 7ef74dd

Please sign in to comment.