Fix sloppy regular expression in TDBConnection.DetectUSEQuery which removes too much of trailing quotes in a database name. See http://www.heidisql.com/forum.php?t=22743

This commit is contained in:
Ansgar Becker
2016-11-24 18:22:23 +00:00
parent 462dcba8de
commit 50d74d9214

View File

@ -3070,7 +3070,7 @@ begin
EscapeFunction := 'E' EscapeFunction := 'E'
else else
EscapeFunction := ''; 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 if rx.Exec(SQL) then begin
FDatabase := Trim(rx.Match[1]); FDatabase := Trim(rx.Match[1]);
FDatabase := DeQuoteIdent(FDatabase); FDatabase := DeQuoteIdent(FDatabase);