Skip to content
Permalink
Browse files

Support selecting wrong cased columns in MariaDB 10.4, so the user ma…

…nager shows up. Closes #599.
  • Loading branch information...
ansgarbecker committed Apr 4, 2019
1 parent 6fb9bb6 commit 2db3fffa7193143be4b276681050b990c4ff7d7d
Showing with 4 additions and 4 deletions.
  1. +4 −4 source/dbconnection.pas
@@ -5576,9 +5576,9 @@ constructor TDBQuery.Create(AOwner: TComponent);
FRecNo := -1;
FRecordCount := 0;
FColumnNames := TStringList.Create;
FColumnNames.CaseSensitive := True;
FColumnNames.CaseSensitive := False;
FColumnOrgNames := TStringList.Create;
FColumnOrgNames.CaseSensitive := True;
FColumnOrgNames.CaseSensitive := False;
FStoreResult := True;
FDBObject := nil;
FFormatSettings := TFormatSettings.Create('en-US');
@@ -6246,9 +6246,9 @@ function TDBQuery.Col(ColumnName: String; IgnoreErrors: Boolean=False): String;
var
idx: Integer;
begin
// ColumnNames is case insensitive, so we can select wrong cased columns in MariaDB 10.4
// See #599
idx := ColumnNames.IndexOf(ColumnName);
if idx = -1 then
idx := ColumnNames.IndexOf(LowerCase(ColumnName));
if idx > -1 then
Result := Col(idx)
else if not IgnoreErrors then

0 comments on commit 2db3fff

Please sign in to comment.
You can’t perform that action at this time.