Permalink
Browse files

Fix sloppy regular expression in TDBConnection.DetectUSEQuery which r…

…emoves too much of trailing quotes in a database name. See http://www.heidisql.com/forum.php?t=22743
  • Loading branch information...
ansgarbecker committed Nov 24, 2016
1 parent 462dcba commit 50d74d92146ce60df0c8a1c1d9bdbec71c4954d1
Showing with 1 addition and 1 deletion.
  1. +1 −1 source/dbconnection.pas
View
@@ -3070,7 +3070,7 @@ procedure TDBConnection.DetectUSEQuery(SQL: String);
EscapeFunction := 'E'
else
EscapeFunction := '';
rx.Expression := StringReplace(rx.Expression, '%s', EscapeFunction+'['+Quotes+']?([^'+Quotes+']+)['+Quotes+']*', [rfReplaceAll]);
rx.Expression := StringReplace(rx.Expression, '%s', EscapeFunction+'['+Quotes+']?(.+)['+Quotes+']?', [rfReplaceAll]);
if rx.Exec(SQL) then begin
FDatabase := Trim(rx.Match[1]);
FDatabase := DeQuoteIdent(FDatabase);

0 comments on commit 50d74d9

Please sign in to comment.