aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2003-08-26 16:09:02 +0000
committerMichael Meskes <meskes@postgresql.org>2003-08-26 16:09:02 +0000
commit47a4e2ed1c53fa23a7a401308109b0352d29f997 (patch)
tree1fd95153bb8deb8e58efb6abcac715178f4f8a58 /src
parentcd0f42e87c6e90805437caabc71e2e36657ff0d8 (diff)
downloadpostgresql-47a4e2ed1c53fa23a7a401308109b0352d29f997.tar.gz
postgresql-47a4e2ed1c53fa23a7a401308109b0352d29f997.zip
Fixed connect statement with username in variable.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/ChangeLog4
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y4
-rw-r--r--src/interfaces/ecpg/test/test1.pgc3
3 files changed, 8 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 4c90dbf0c00..78099437431 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -1604,6 +1604,10 @@ Fri Aug 1 08:54:02 CEST 2003
Mon Aug 25 13:24:27 CEST 2003
- Synced parser.
+
+Tue Aug 26 18:06:45 CEST 2003
+
+ - Fixed processing of connect statement with username as variable.
- Set ecpg version to 3.0.0
- Set ecpg library to 4.0.0
- Set pgtypes library to 1.0.0
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 7cd7b263891..e295d1f164a 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.252 2003/08/25 13:44:00 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.253 2003/08/26 16:09:01 meskes Exp $ */
/* Copyright comment */
%{
@@ -4265,7 +4265,7 @@ user_name: UserId
{
if ($1[0] == '\"')
$$ = $1;
- else if (strcmp($1, "?") == 0) /* variable */
+ else if (strcmp($1, " ?") == 0) /* variable */
{
enum ECPGttype type = argsinsert->variable->type->type;
diff --git a/src/interfaces/ecpg/test/test1.pgc b/src/interfaces/ecpg/test/test1.pgc
index 05fcda0ca9e..753c0abae5d 100644
--- a/src/interfaces/ecpg/test/test1.pgc
+++ b/src/interfaces/ecpg/test/test1.pgc
@@ -52,6 +52,7 @@ exec sql endif;
char command[128];
char *connection="pm";
int how_many;
+ char *user="postgres";
exec sql end declare section;
exec sql var name is string[AMOUNT];
char msg[128];
@@ -65,7 +66,7 @@ exec sql end declare section;
exec sql connect to mm as main;
strcpy(msg, "connect");
- exec sql connect to pm;
+ exec sql connect to pm user :user;
strcpy(msg, "create");
exec sql at main create table "Test" (name char(NAMELEN), amount int, letter char(1));