Revert r5136, which removes support for single quotes in database names again, to fix a new bug when finding the right PG database name in a query like SET search_path TO E'information_schema', E'public'. See http://www.heidisql.com/forum.php?t=22799

This commit is contained in:
Ansgar Becker
2016-11-29 14:15:42 +00:00
parent cdea0923b3
commit 3ffcafac05

View File

@@ -3070,7 +3070,7 @@ begin
EscapeFunction := 'E'
else
EscapeFunction := '';
rx.Expression := StringReplace(rx.Expression, '%s', EscapeFunction+'['+Quotes+']?(.+)['+Quotes+']?', [rfReplaceAll]);
rx.Expression := StringReplace(rx.Expression, '%s', EscapeFunction+'['+Quotes+']?([^'+Quotes+']+)['+Quotes+']*', [rfReplaceAll]);
if rx.Exec(SQL) then begin
FDatabase := Trim(rx.Match[1]);
FDatabase := DeQuoteIdent(FDatabase);