Skip to content

Commit

Permalink
Trim database names when passed as semicolon separated list. See http…
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarbecker committed Jun 7, 2016
1 parent 3641a18 commit 45d74f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/dbconnection.pas
Expand Up @@ -3293,6 +3293,7 @@ function TDBConnection.NdbClusterVersionInt: Integer;
function TDBConnection.GetAllDatabases: TStringList;
var
rx: TRegExpr;
dbname: String;
begin
// Get user passed delimited list
if not Assigned(FAllDatabases) then begin
Expand All @@ -3303,8 +3304,9 @@ function TDBConnection.GetAllDatabases: TStringList;
rx.ModifierG := True;
if rx.Exec(FParameters.AllDatabasesStr) then while true do begin
// Add if not a duplicate
if FAllDatabases.IndexOf(rx.Match[0]) = -1 then
FAllDatabases.Add(rx.Match[0]);
dbname := Trim(rx.Match[0]);
if FAllDatabases.IndexOf(dbname) = -1 then
FAllDatabases.Add(dbname);
if not rx.ExecNext then
break;
end;
Expand Down

0 comments on commit 45d74f2

Please sign in to comment.