aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2006-06-26 14:12:42 +0000
committerMichael Meskes <meskes@postgresql.org>2006-06-26 14:12:42 +0000
commit88f396e1cb7409d4ec648718601d4b2c324fd4f5 (patch)
tree4b4558f1a7ed75712401c2ea63e8137dd9d63cd4 /src
parent1bdea12e5c3296ed91b356fc11fe722f67bfc2c8 (diff)
downloadpostgresql-88f396e1cb7409d4ec648718601d4b2c324fd4f5.tar.gz
postgresql-88f396e1cb7409d4ec648718601d4b2c324fd4f5.zip
Added missing braces to prevent a segfault after usage of an undeclared cursor.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 96f8a8a5d56..327fd855df9 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.311.2.2 2005/12/02 15:04:48 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.311.2.3 2006/06/26 14:12:42 meskes Exp $ */
/* Copyright comment */
%{
@@ -292,6 +292,7 @@ add_additional_variables(char *name, bool insert)
mmerror(PARSE_ERROR, ET_ERROR, "trying to access an undeclared cursor %s\n", name);
return NULL;
}
+
if (insert)
{
/* add all those input variables that were given earlier
@@ -831,8 +832,10 @@ stmt: AlterDatabaseStmt { output_statement($1, 0, connection); }
struct cursor *ptr;
if ((ptr = add_additional_variables($1, true)) != NULL)
+ {
output_statement(mm_strdup(ptr->command), 0, ptr->connection ? mm_strdup(ptr->connection) : NULL);
- ptr->opened = true;
+ ptr->opened = true;
+ }
}
| ECPGPrepare
{