Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 83fa037

Browse files
author
Michael Meskes
committed
Changed ECPG outofscope handling to always print out statements in the same order
so regression testing is possible, by Zoltan Boszormenyi
1 parent f180856 commit 83fa037

File tree

8 files changed

+124
-159
lines changed

8 files changed

+124
-159
lines changed

src/interfaces/ecpg/preproc/ecpg.addons

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.15 2010/01/26 09:07:31 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.addons,v 1.16 2010/01/29 16:28:13 meskes Exp $ */
22
ECPG: stmtClosePortalStmt block
33
{
44
if (INFORMIX_MODE)
@@ -331,16 +331,11 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
331331
comment = cat_str(3, make_str("/*"), c1, make_str("*/"));
332332

333333
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),
334+
$$ = cat_str(3, adjust_outofscope_cursor_vars(this),
337335
make_str("ECPG_informix_reset_sqlca();"),
338336
comment);
339337
else
340-
$$ = cat_str(3,
341-
adjust_outofscope_cursor_vars(this, true),
342-
adjust_outofscope_cursor_vars(this, false),
343-
comment);
338+
$$ = cat2_str(adjust_outofscope_cursor_vars(this), comment);
344339
}
345340
ECPG: ClosePortalStmtCLOSEcursor_name block
346341
{

src/interfaces/ecpg/preproc/ecpg.header

Lines changed: 98 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.12 2010/01/29 15:57:01 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.13 2010/01/29 16:28:13 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -227,7 +227,7 @@ create_questionmarks(char *name, bool array)
227227
}
228228

229229
static char *
230-
adjust_outofscope_cursor_vars(struct cursor *cur, bool insert)
230+
adjust_outofscope_cursor_vars(struct cursor *cur)
231231
{
232232
/* Informix accepts DECLARE with variables that are out of scope when OPEN is called.
233233
* For instance you can DECLARE a cursor in one function, and OPEN/FETCH/CLOSE
@@ -240,132 +240,137 @@ adjust_outofscope_cursor_vars(struct cursor *cur, bool insert)
240240
* instead of the variable. Do it only for local variables, not for globals.
241241
*/
242242

243-
struct arguments *list;
244-
struct arguments *ptr;
245-
struct arguments *newlist = NULL;
246-
struct variable *newvar, *newind;
247243
char *result = make_str("");
244+
int insert;
248245

249-
list = (insert ? cur->argsinsert : cur->argsresult);
250-
251-
for (ptr = list; ptr != NULL; ptr = ptr->next)
246+
for (insert = 1; insert >= 0; insert--)
252247
{
253-
char temp[20]; /* this should be sufficient unless you have 8 byte integers */
254-
char *original_var;
255-
bool skip_set_var = false;
248+
struct arguments *list;
249+
struct arguments *ptr;
250+
struct arguments *newlist = NULL;
251+
struct variable *newvar, *newind;
256252

257-
/* change variable name to "ECPGget_var(<counter>)" */
258-
original_var = ptr->variable->name;
259-
sprintf(temp, "%d))", ecpg_internal_var);
253+
list = (insert ? cur->argsinsert : cur->argsresult);
260254

261-
/* Don't emit ECPGset_var() calls for global variables */
262-
if (ptr->variable->brace_level == 0)
263-
{
264-
newvar = ptr->variable;
265-
skip_set_var = true;
266-
}
267-
else if ((ptr->variable->type->type == ECPGt_char_variable) && (!strncmp(ptr->variable->name, "ECPGprepared_statement", strlen("ECPGprepared_statement"))))
268-
{
269-
newvar = ptr->variable;
270-
skip_set_var = true;
271-
}
272-
else if ((ptr->variable->type->type != ECPGt_varchar && ptr->variable->type->type != ECPGt_char && ptr->variable->type->type != ECPGt_unsigned_char && ptr->variable->type->type != ECPGt_string) && atoi(ptr->variable->type->size) > 1)
255+
for (ptr = list; ptr != NULL; ptr = ptr->next)
273256
{
274-
newvar = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->u.element->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type, make_str("1"), ptr->variable->type->u.element->lineno), ptr->variable->type->size), 0);
275-
sprintf(temp, "%d, (", ecpg_internal_var++);
276-
}
277-
else if ((ptr->variable->type->type == ECPGt_varchar || ptr->variable->type->type == ECPGt_char || ptr->variable->type->type == ECPGt_unsigned_char || ptr->variable->type->type == ECPGt_string) && atoi(ptr->variable->type->size) > 1)
278-
{
279-
newvar = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size, ptr->variable->type->lineno), 0);
280-
if (ptr->variable->type->type == ECPGt_varchar)
281-
sprintf(temp, "%d, &(", ecpg_internal_var++);
282-
else
283-
sprintf(temp, "%d, (", ecpg_internal_var++);
284-
}
285-
else if (ptr->variable->type->type == ECPGt_struct || ptr->variable->type->type == ECPGt_union)
286-
{
287-
sprintf(temp, "%d)))", ecpg_internal_var);
288-
newvar = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->variable->type->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->variable->type->u.members, ptr->variable->type->type, ptr->variable->type->type_name, ptr->variable->type->struct_sizeof), 0);
289-
sprintf(temp, "%d, &(", ecpg_internal_var++);
290-
}
291-
else if (ptr->variable->type->type == ECPGt_array)
292-
{
293-
if (ptr->variable->type->u.element->type == ECPGt_struct || ptr->variable->type->u.element->type == ECPGt_union)
257+
char temp[20];
258+
char *original_var;
259+
bool skip_set_var = false;
260+
261+
/* change variable name to "ECPGget_var(<counter>)" */
262+
original_var = ptr->variable->name;
263+
sprintf(temp, "%d))", ecpg_internal_var);
264+
265+
/* Don't emit ECPGset_var() calls for global variables */
266+
if (ptr->variable->brace_level == 0)
294267
{
295-
sprintf(temp, "%d)))", ecpg_internal_var);
296-
newvar = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->variable->type->u.element->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->variable->type->u.element->u.members, ptr->variable->type->u.element->type, ptr->variable->type->u.element->type_name, ptr->variable->type->u.element->struct_sizeof), 0);
268+
newvar = ptr->variable;
269+
skip_set_var = true;
270+
}
271+
else if ((ptr->variable->type->type == ECPGt_char_variable) && (!strncmp(ptr->variable->name, "ECPGprepared_statement", strlen("ECPGprepared_statement"))))
272+
{
273+
newvar = ptr->variable;
274+
skip_set_var = true;
275+
}
276+
else if ((ptr->variable->type->type != ECPGt_varchar && ptr->variable->type->type != ECPGt_char && ptr->variable->type->type != ECPGt_unsigned_char && ptr->variable->type->type != ECPGt_string) && atoi(ptr->variable->type->size) > 1)
277+
{
278+
newvar = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->u.element->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type, make_str("1"), ptr->variable->type->u.element->lineno), ptr->variable->type->size), 0);
297279
sprintf(temp, "%d, (", ecpg_internal_var++);
298280
}
299-
else
281+
else if ((ptr->variable->type->type == ECPGt_varchar || ptr->variable->type->type == ECPGt_char || ptr->variable->type->type == ECPGt_unsigned_char || ptr->variable->type->type == ECPGt_string) && atoi(ptr->variable->type->size) > 1)
300282
{
301-
newvar = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type, ptr->variable->type->u.element->size, ptr->variable->type->u.element->lineno), ptr->variable->type->size), 0);
302-
sprintf(temp, "%d, &(", ecpg_internal_var++);
283+
newvar = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size, ptr->variable->type->lineno), 0);
284+
if (ptr->variable->type->type == ECPGt_varchar)
285+
sprintf(temp, "%d, &(", ecpg_internal_var++);
286+
else
287+
sprintf(temp, "%d, (", ecpg_internal_var++);
303288
}
304-
}
305-
else
306-
{
307-
newvar = new_variable(cat_str(4, make_str("*("), mm_strdup(ecpg_type_name(ptr->variable->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size, ptr->variable->type->lineno), 0);
308-
sprintf(temp, "%d, &(", ecpg_internal_var++);
309-
}
310-
311-
/* create call to "ECPGset_var(<counter>, <pointer>, <line number>)" */
312-
if (!skip_set_var)
313-
result = cat_str(5, result, make_str("ECPGset_var("), mm_strdup(temp), mm_strdup(original_var), make_str("), __LINE__);\n"));
314-
315-
/* now the indicator if there is one and it's not a global variable */
316-
if ((ptr->indicator->type->type == ECPGt_NO_INDICATOR) || (ptr->indicator->brace_level == 0))
317-
{
318-
newind = ptr->indicator;
319-
}
320-
else
321-
{
322-
/* change variable name to "ECPGget_var(<counter>)" */
323-
original_var = ptr->indicator->name;
324-
sprintf(temp, "%d))", ecpg_internal_var);
325-
326-
if (ptr->indicator->type->type == ECPGt_struct || ptr->indicator->type->type == ECPGt_union)
289+
else if (ptr->variable->type->type == ECPGt_struct || ptr->variable->type->type == ECPGt_union)
327290
{
328291
sprintf(temp, "%d)))", ecpg_internal_var);
329-
newind = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->indicator->type->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->indicator->type->u.members, ptr->indicator->type->type, ptr->indicator->type->type_name, ptr->indicator->type->struct_sizeof), 0);
292+
newvar = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->variable->type->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->variable->type->u.members, ptr->variable->type->type, ptr->variable->type->type_name, ptr->variable->type->struct_sizeof), 0);
330293
sprintf(temp, "%d, &(", ecpg_internal_var++);
331294
}
332-
else if (ptr->indicator->type->type == ECPGt_array)
295+
else if (ptr->variable->type->type == ECPGt_array)
333296
{
334-
if (ptr->indicator->type->u.element->type == ECPGt_struct || ptr->indicator->type->u.element->type == ECPGt_union)
297+
if (ptr->variable->type->u.element->type == ECPGt_struct || ptr->variable->type->u.element->type == ECPGt_union)
335298
{
336299
sprintf(temp, "%d)))", ecpg_internal_var);
337-
newind = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->indicator->type->u.element->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->indicator->type->u.element->u.members, ptr->indicator->type->u.element->type, ptr->indicator->type->u.element->type_name, ptr->indicator->type->u.element->struct_sizeof), 0);
300+
newvar = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->variable->type->u.element->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->variable->type->u.element->u.members, ptr->variable->type->u.element->type, ptr->variable->type->u.element->type_name, ptr->variable->type->u.element->struct_sizeof), 0);
338301
sprintf(temp, "%d, (", ecpg_internal_var++);
339302
}
340303
else
341304
{
342-
newind = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->indicator->type->u.element->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->indicator->type->u.element->type, ptr->indicator->type->u.element->size, ptr->indicator->type->u.element->lineno), ptr->indicator->type->size), 0);
305+
newvar = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type, ptr->variable->type->u.element->size, ptr->variable->type->u.element->lineno), ptr->variable->type->size), 0);
343306
sprintf(temp, "%d, &(", ecpg_internal_var++);
344307
}
345308
}
346-
else if (atoi(ptr->indicator->type->size) > 1)
309+
else
347310
{
348-
newind = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->indicator->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->indicator->type->type, ptr->indicator->type->size, ptr->variable->type->lineno), 0);
349-
sprintf(temp, "%d, (", ecpg_internal_var++);
311+
newvar = new_variable(cat_str(4, make_str("*("), mm_strdup(ecpg_type_name(ptr->variable->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size, ptr->variable->type->lineno), 0);
312+
sprintf(temp, "%d, &(", ecpg_internal_var++);
313+
}
314+
315+
/* create call to "ECPGset_var(<counter>, <pointer>. <line number>)" */
316+
if (!skip_set_var)
317+
result = cat_str(5, result, make_str("ECPGset_var("), mm_strdup(temp), mm_strdup(original_var), make_str("), __LINE__);\n"));
318+
319+
/* now the indicator if there is one and it's not a global variable */
320+
if ((ptr->indicator->type->type == ECPGt_NO_INDICATOR) || (ptr->indicator->brace_level == 0))
321+
{
322+
newind = ptr->indicator;
350323
}
351324
else
352325
{
353-
newind = new_variable(cat_str(4, make_str("*("), mm_strdup(ecpg_type_name(ptr->indicator->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->indicator->type->type, ptr->indicator->type->size, ptr->variable->type->lineno), 0);
354-
sprintf(temp, "%d, &(", ecpg_internal_var++);
326+
/* change variable name to "ECPGget_var(<counter>)" */
327+
original_var = ptr->indicator->name;
328+
sprintf(temp, "%d))", ecpg_internal_var);
329+
330+
if (ptr->indicator->type->type == ECPGt_struct || ptr->indicator->type->type == ECPGt_union)
331+
{
332+
sprintf(temp, "%d)))", ecpg_internal_var);
333+
newind = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->indicator->type->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->indicator->type->u.members, ptr->indicator->type->type, ptr->indicator->type->type_name, ptr->indicator->type->struct_sizeof), 0);
334+
sprintf(temp, "%d, &(", ecpg_internal_var++);
335+
}
336+
else if (ptr->indicator->type->type == ECPGt_array)
337+
{
338+
if (ptr->indicator->type->u.element->type == ECPGt_struct || ptr->indicator->type->u.element->type == ECPGt_union)
339+
{
340+
sprintf(temp, "%d)))", ecpg_internal_var);
341+
newind = new_variable(cat_str(4, make_str("(*("), mm_strdup(ptr->indicator->type->u.element->type_name), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_struct_type(ptr->indicator->type->u.element->u.members, ptr->indicator->type->u.element->type, ptr->indicator->type->u.element->type_name, ptr->indicator->type->u.element->struct_sizeof), 0);
342+
sprintf(temp, "%d, (", ecpg_internal_var++);
343+
}
344+
else
345+
{
346+
newind = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->indicator->type->u.element->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->indicator->type->u.element->type, ptr->indicator->type->u.element->size, ptr->indicator->type->u.element->lineno), ptr->indicator->type->size), 0);
347+
sprintf(temp, "%d, &(", ecpg_internal_var++);
348+
}
349+
}
350+
else if (atoi(ptr->indicator->type->size) > 1)
351+
{
352+
newind = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->indicator->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->indicator->type->type, ptr->indicator->type->size, ptr->variable->type->lineno), 0);
353+
sprintf(temp, "%d, (", ecpg_internal_var++);
354+
}
355+
else
356+
{
357+
newind = new_variable(cat_str(4, make_str("*("), mm_strdup(ecpg_type_name(ptr->indicator->type->type)), make_str(" *)(ECPGget_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->indicator->type->type, ptr->indicator->type->size, ptr->variable->type->lineno), 0);
358+
sprintf(temp, "%d, &(", ecpg_internal_var++);
359+
}
360+
361+
/* create call to "ECPGset_var(<counter>, <pointer>. <line number>)" */
362+
result = cat_str(5, result, make_str("ECPGset_var("), mm_strdup(temp), mm_strdup(original_var), make_str("), __LINE__);\n"));
355363
}
356364

357-
/* create call to "ECPGset_var(<counter>, <pointer>, <line number>)" */
358-
result = cat_str(5, result, make_str("ECPGset_var("), mm_strdup(temp), mm_strdup(original_var), make_str("), __LINE__);\n"));
365+
add_variable_to_tail(&newlist, newvar, newind);
359366
}
360367

361-
add_variable_to_tail(&newlist, newvar, newind);
368+
if (insert)
369+
cur->argsinsert_oos = newlist;
370+
else
371+
cur->argsresult_oos = newlist;
362372
}
363373

364-
if (insert)
365-
cur->argsinsert_oos = newlist;
366-
else
367-
cur->argsresult_oos = newlist;
368-
369374
return result;
370375
}
371376

src/interfaces/ecpg/preproc/ecpg.trailer

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.19 2010/01/26 09:07:31 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.20 2010/01/29 16:28:13 meskes Exp $ */
22

33
statements: /*EMPTY*/
44
| statements statement
@@ -332,16 +332,11 @@ ECPGCursorStmt: DECLARE cursor_name cursor_options CURSOR opt_hold FOR prepared
332332
comment = cat_str(3, make_str("/*"), mm_strdup(this->command), make_str("*/"));
333333

334334
if ((braces_open > 0) && INFORMIX_MODE) /* we're in a function */
335-
$$ = cat_str(4,
336-
adjust_outofscope_cursor_vars(this, true),
337-
adjust_outofscope_cursor_vars(this, false),
335+
$$ = cat_str(3, adjust_outofscope_cursor_vars(this),
338336
make_str("ECPG_informix_reset_sqlca();"),
339337
comment);
340338
else
341-
$$ = cat_str(3,
342-
adjust_outofscope_cursor_vars(this, true),
343-
adjust_outofscope_cursor_vars(this, false),
344-
comment);
339+
$$ = cat2_str(adjust_outofscope_cursor_vars(this), comment);
345340
}
346341
;
347342

src/interfaces/ecpg/test/expected/preproc-cursor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ if (sqlca.sqlcode < 0) exit (1);}
287287
/* Dynamic cursorname test with INTO list in DECLARE stmt */
288288

289289
strcpy(msg, "declare");
290-
ECPGset_var( 3, &( curname2 ), __LINE__);\
291-
ECPGset_var( 1, ( t ), __LINE__);\
292-
ECPGset_var( 2, &( id ), __LINE__);\
290+
ECPGset_var( 1, &( curname2 ), __LINE__);\
291+
ECPGset_var( 2, ( t ), __LINE__);\
292+
ECPGset_var( 3, &( id ), __LINE__);\
293293
/* declare $0 cursor for select id , t from t1 */
294294
#line 100 "cursor.pgc"
295295

src/interfaces/ecpg/test/expected/preproc-outofscope.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -305,25 +305,19 @@ if (sqlca.sqlcode < 0) exit (1);}
305305
if (sqlca.sqlcode < 0) exit (1);}
306306
#line 85 "outofscope.pgc"
307307

308-
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , '\"a\"' , - 1.0 , 'nan' :: float8 , 'a' )", ECPGt_EOIT, ECPGt_EORT);
308+
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' )", ECPGt_EOIT, ECPGt_EORT);
309309
#line 86 "outofscope.pgc"
310310

311311
if (sqlca.sqlcode < 0) exit (1);}
312312
#line 86 "outofscope.pgc"
313313

314-
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' )", ECPGt_EOIT, ECPGt_EORT);
315-
#line 87 "outofscope.pgc"
316-
317-
if (sqlca.sqlcode < 0) exit (1);}
318-
#line 87 "outofscope.pgc"
319-
320314

321315
strcpy(msg, "commit");
322316
{ ECPGtrans(__LINE__, NULL, "commit");
323-
#line 90 "outofscope.pgc"
317+
#line 89 "outofscope.pgc"
324318

325319
if (sqlca.sqlcode < 0) exit (1);}
326-
#line 90 "outofscope.pgc"
320+
#line 89 "outofscope.pgc"
327321

328322

329323
/* Test out-of-scope DECLARE/OPEN/FETCH/CLOSE */
@@ -332,7 +326,7 @@ if (sqlca.sqlcode < 0) exit (1);}
332326
open_cur1();
333327

334328
/* exec sql whenever not found break ; */
335-
#line 97 "outofscope.pgc"
329+
#line 96 "outofscope.pgc"
336330

337331

338332
while (1)
@@ -353,26 +347,26 @@ if (sqlca.sqlcode < 0) exit (1);}
353347

354348
strcpy(msg, "drop");
355349
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table a1", ECPGt_EOIT, ECPGt_EORT);
356-
#line 116 "outofscope.pgc"
350+
#line 115 "outofscope.pgc"
357351

358352
if (sqlca.sqlcode < 0) exit (1);}
359-
#line 116 "outofscope.pgc"
353+
#line 115 "outofscope.pgc"
360354

361355

362356
strcpy(msg, "commit");
363357
{ ECPGtrans(__LINE__, NULL, "commit");
364-
#line 119 "outofscope.pgc"
358+
#line 118 "outofscope.pgc"
365359

366360
if (sqlca.sqlcode < 0) exit (1);}
367-
#line 119 "outofscope.pgc"
361+
#line 118 "outofscope.pgc"
368362

369363

370364
strcpy(msg, "disconnect");
371365
{ ECPGdisconnect(__LINE__, "CURRENT");
372-
#line 122 "outofscope.pgc"
366+
#line 121 "outofscope.pgc"
373367

374368
if (sqlca.sqlcode < 0) exit (1);}
375-
#line 122 "outofscope.pgc"
369+
#line 121 "outofscope.pgc"
376370

377371

378372
return (0);

0 commit comments

Comments
 (0)