From 3ffcafac059e4c6ceb3fddac2de961b3ed800462 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 29 Nov 2016 14:15:42 +0000 Subject: [PATCH] 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 --- source/dbconnection.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 57a26d1c..6a00e70b 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -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);