aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interfaces/ecpg/ecpglib/connect.c5
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.trailer2
-rw-r--r--src/interfaces/ecpg/test/expected/connect-test5.c2
-rw-r--r--src/interfaces/ecpg/test/expected/connect-test5.stderr2
4 files changed, 7 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 8afb1f0a26f..b24b310ce59 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -579,7 +579,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
* The options string contains "keyword=value" pairs separated by
* '&'s. We must break this up into keywords and values to pass to
* libpq (it's okay to scribble on the options string). We ignore
- * spaces just before each keyword or value.
+ * spaces just before each keyword or value. (The preprocessor used
+ * to add spaces around '&'s, making it necessary to ignore spaces
+ * before keywords here. While it no longer does that, we still must
+ * skip spaces to support code compiled with older preprocessors.)
*/
for (str = options; *str;)
{
diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer
index b6233e5e530..f3ab73bed61 100644
--- a/src/interfaces/ecpg/preproc/ecpg.trailer
+++ b/src/interfaces/ecpg/preproc/ecpg.trailer
@@ -348,7 +348,7 @@ connect_options: ColId opt_opt_value
if (strcmp($3, "&") != 0)
mmerror(PARSE_ERROR, ET_ERROR, "unrecognized token \"%s\"", $3);
- $$ = cat_str(3, make2_str($1, $2), $3, $4);
+ $$ = make3_str(make2_str($1, $2), $3, $4);
}
;
diff --git a/src/interfaces/ecpg/test/expected/connect-test5.c b/src/interfaces/ecpg/test/expected/connect-test5.c
index ec1514ed9ab..fc650f5cd57 100644
--- a/src/interfaces/ecpg/test/expected/connect-test5.c
+++ b/src/interfaces/ecpg/test/expected/connect-test5.c
@@ -117,7 +117,7 @@ main(void)
#line 56 "test5.pgc"
- { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression?connect_timeout=180 & client_encoding=sql_ascii" , "regress_ecpg_user1" , "connectpw" , "main", 0); }
+ { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression?connect_timeout=180&client_encoding=sql_ascii" , "regress_ecpg_user1" , "connectpw" , "main", 0); }
#line 58 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
diff --git a/src/interfaces/ecpg/test/expected/connect-test5.stderr b/src/interfaces/ecpg/test/expected/connect-test5.stderr
index 51cc18916a1..037db217586 100644
--- a/src/interfaces/ecpg/test/expected/connect-test5.stderr
+++ b/src/interfaces/ecpg/test/expected/connect-test5.stderr
@@ -50,7 +50,7 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> with options connect_timeout=180 & client_encoding=sql_ascii for user regress_ecpg_user1
+[NO_PID]: ECPGconnect: opening database ecpg2_regression on <DEFAULT> port <DEFAULT> with options connect_timeout=180&client_encoding=sql_ascii for user regress_ecpg_user1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection main closed
[NO_PID]: sqlca: code: 0, state: 00000