Skip to content
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 50d74d9
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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.