1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-17 06:41:24 +03:00

Fixed segfault when detecting undefined cursor.

This commit is contained in:
Michael Meskes 2003-05-22 17:09:00 +00:00
parent c120f4ba0a
commit dbd55d3a5b

View File

@ -1,4 +1,4 @@
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.220 2003/05/22 07:58:41 meskes Exp $ */ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.221 2003/05/22 17:09:00 meskes Exp $ */
/* Copyright comment */ /* Copyright comment */
%{ %{
@ -610,7 +610,8 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
snprintf(errortext, sizeof(errortext), "trying to open undeclared cursor %s\n", $1); snprintf(errortext, sizeof(errortext), "trying to open undeclared cursor %s\n", $1);
mmerror(PARSE_ERROR, ET_ERROR, errortext); mmerror(PARSE_ERROR, ET_ERROR, errortext);
} }
else
{
/* merge variables given in prepare statement with those given here */ /* merge variables given in prepare statement with those given here */
for (p = ptr->argsinsert; p; p = p->next) for (p = ptr->argsinsert; p; p = p->next)
append_variable(&argsinsert, p->variable, p->var_array_element, p->indicator, p->ind_array_element); append_variable(&argsinsert, p->variable, p->var_array_element, p->indicator, p->ind_array_element);
@ -620,6 +621,7 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
output_statement(mm_strdup(ptr->command), 0, ptr->connection ? mm_strdup(ptr->connection) : NULL); output_statement(mm_strdup(ptr->command), 0, ptr->connection ? mm_strdup(ptr->connection) : NULL);
} }
}
| ECPGPrepare | ECPGPrepare
{ {
if (connection) if (connection)