You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ma...@apache.org on 2025/01/10 02:28:32 UTC

(cloudberry) 17/18: Escape database name for dbconn.

This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 87f3d033f3d6993e769e740858bf8d0da6904dca
Author: Zhenghua Lyu <ka...@gmail.com>
AuthorDate: Mon Aug 22 09:48:12 2022 +0800

    Escape database name for dbconn.
    
    This is really a bug of the Python Package PyGreSQL,
    see issue: https://github.com/PyGreSQL/PyGreSQL/issues/77
    
    As a workaround, let's modify GPDB's code to manually
    escape before passing args to pgdb.
---
 src/test/regress/input/dispatch.source  | 11 +++++------
 src/test/regress/output/dispatch.source | 10 ++++------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/test/regress/input/dispatch.source b/src/test/regress/input/dispatch.source
index 4068dc944e..41ed0a9bb7 100644
--- a/src/test/regress/input/dispatch.source
+++ b/src/test/regress/input/dispatch.source
@@ -52,12 +52,11 @@ reset client_min_messages;
 CREATE DATABASE "funny""db'with\\quotes";
 ALTER DATABASE "funny""db'with\\quotes" SET search_path="funny""schema'with\\quotes";
 
--- GPDB_91_MERGE_FIXME: It would be good to leave the database in place, to
--- also test gpcheckcat and pg_upgrade after all the regression tests have
--- completed. As of this writing pg_upgrade does not in fact handle that well.
--- Remove this DROP DATABASE once it's fixed. That should happen when we
--- reach commit a2385cac13, which was backported to PostgreSQL 9.1.
-DROP DATABASE "funny""db'with\\quotes";
+-- test if we can connect using dbconn
+\! python3 test_dbconn.py 0
+
+-- Leave the database in place, to also test gpcheckcat and pg_upgrade after
+-- all the regression tests have completed.
 
 -- set_config() used to have quoting problems as well when dispatching to
 -- segments.
diff --git a/src/test/regress/output/dispatch.source b/src/test/regress/output/dispatch.source
index cd8d872d86..36a66dc749 100644
--- a/src/test/regress/output/dispatch.source
+++ b/src/test/regress/output/dispatch.source
@@ -67,12 +67,10 @@ DROP DATABASE IF EXISTS "funny""db'with\\quotes";
 reset client_min_messages;
 CREATE DATABASE "funny""db'with\\quotes";
 ALTER DATABASE "funny""db'with\\quotes" SET search_path="funny""schema'with\\quotes";
--- GPDB_91_MERGE_FIXME: It would be good to leave the database in place, to
--- also test gpcheckcat and pg_upgrade after all the regression tests have
--- completed. As of this writing pg_upgrade does not in fact handle that well.
--- Remove this DROP DATABASE once it's fixed. That should happen when we
--- reach commit a2385cac13, which was backported to PostgreSQL 9.1.
-DROP DATABASE "funny""db'with\\quotes";
+-- test if we can connect using dbconn
+\! python3 test_dbconn.py 0
+-- Leave the database in place, to also test gpcheckcat and pg_upgrade after
+-- all the regression tests have completed.
 -- set_config() used to have quoting problems as well when dispatching to
 -- segments.
 CREATE TABLE IF NOT EXISTS should_be_visible();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org