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 $ */
2
2
ECPG: stmtClosePortalStmt block
3
3
{
4
4
if (INFORMIX_MODE)
@@ -310,11 +310,14 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
310
310
311
311
this->next = cur;
312
312
this->name = $2;
313
+ this->function = (current_function ? mm_strdup(current_function) : NULL);
313
314
this->connection = connection;
314
315
this->opened = false;
315
316
this->command = cat_str(7, make_str("declare"), cursor_marker, $3, make_str("cursor"), $5, make_str("for"), $7);
316
317
this->argsinsert = argsinsert;
318
+ this->argsinsert_oos = NULL;
317
319
this->argsresult = argsresult;
320
+ this->argsresult_oos = NULL;
318
321
argsinsert = argsresult = NULL;
319
322
cur = this;
320
323
@@ -327,17 +330,17 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
327
330
}
328
331
comment = cat_str(3, make_str("/*"), c1, make_str("*/"));
329
332
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);
339
339
else
340
- $$ = comment;
340
+ $$ = cat_str(3,
341
+ adjust_outofscope_cursor_vars(this, true),
342
+ adjust_outofscope_cursor_vars(this, false),
343
+ comment);
341
344
}
342
345
ECPG: ClosePortalStmtCLOSEcursor_name block
343
346
{
0 commit comments