Skip to content

Commit dbd55d3

Browse files
author
Michael Meskes
committed
Fixed segfault when detecting undefined cursor.
1 parent c120f4b commit dbd55d3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.220 2003/05/22 07:58:41 meskes Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.221 2003/05/22 17:09:00 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -610,15 +610,17 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
610610
snprintf(errortext, sizeof(errortext), "trying to open undeclared cursor %s\n", $1);
611611
mmerror(PARSE_ERROR, ET_ERROR, errortext);
612612
}
613+
else
614+
{
615+
/* merge variables given in prepare statement with those given here */
616+
for (p = ptr->argsinsert; p; p = p->next)
617+
append_variable(&argsinsert, p->variable, p->var_array_element, p->indicator, p->ind_array_element);
613618

614-
/* merge variables given in prepare statement with those given here */
615-
for (p = ptr->argsinsert; p; p = p->next)
616-
append_variable(&argsinsert, p->variable, p->var_array_element, p->indicator, p->ind_array_element);
617-
618-
for (p = ptr->argsresult; p; p = p->next)
619-
add_variable(&argsresult, p->variable, p->var_array_element, p->indicator, p->ind_array_element);
619+
for (p = ptr->argsresult; p; p = p->next)
620+
add_variable(&argsresult, p->variable, p->var_array_element, p->indicator, p->ind_array_element);
620621

621-
output_statement(mm_strdup(ptr->command), 0, ptr->connection ? mm_strdup(ptr->connection) : NULL);
622+
output_statement(mm_strdup(ptr->command), 0, ptr->connection ? mm_strdup(ptr->connection) : NULL);
623+
}
622624
}
623625
| ECPGPrepare
624626
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy