1- /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.14 2010/01/15 10:44:37 meskes Exp $ */
1+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.15 2010/01/26 09:07:31 meskes Exp $ */
22ECPG: stmtClosePortalStmt block
33 {
44 if (INFORMIX_MODE)
@@ -310,11 +310,14 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
310310
311311 this->next = cur;
312312 this->name = $2;
313+ this->function = (current_function ? mm_strdup(current_function) : NULL);
313314 this->connection = connection;
314315 this->opened = false;
315316 this->command = cat_str(7, make_str("declare"), cursor_marker, $3, make_str("cursor"), $5, make_str("for"), $7);
316317 this->argsinsert = argsinsert;
318+ this->argsinsert_oos = NULL;
317319 this->argsresult = argsresult;
320+ this->argsresult_oos = NULL;
318321 argsinsert = argsresult = NULL;
319322 cur = this;
320323
@@ -327,17 +330,17 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
327330 }
328331 comment = cat_str(3, make_str("/*"), c1, make_str("*/"));
329332
330- if (INFORMIX_MODE)
331- {
332- if (braces_open > 0) /* we're in a function */
333- {
334- $$ = cat_str(4, adjust_informix(this->argsinsert), adjust_informix(this->argsresult), make_str("ECPG_informix_reset_sqlca();"), comment);
335- }
336- else
337- $$ = cat_str(3, adjust_informix(this->argsinsert), adjust_informix(this->argsresult), comment);
338- }
333+ if ((braces_open > 0) && INFORMIX_MODE) /* we're in a function */
334+ $$ = cat_str(4,
335+ adjust_outofscope_cursor_vars(this, true),
336+ adjust_outofscope_cursor_vars(this, false),
337+ make_str("ECPG_informix_reset_sqlca();"),
338+ comment);
339339 else
340- $$ = comment;
340+ $$ = cat_str(3,
341+ adjust_outofscope_cursor_vars(this, true),
342+ adjust_outofscope_cursor_vars(this, false),
343+ comment);
341344 }
342345ECPG: ClosePortalStmtCLOSEcursor_name block
343346 {
0 commit comments