Permalink
Browse files

Revert r5136, which removes support for single quotes in database nam…

…es 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
  • Loading branch information...
ansgarbecker committed Nov 29, 2016
1 parent cdea092 commit 3ffcafac059e4c6ceb3fddac2de961b3ed800462
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+']?', [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);

0 comments on commit 3ffcafa

Please sign in to comment.