Change error handling of out of scope variables in ecpg.

The function called can result in an out of memory error that subsequently was
disregarded. Instead it should set the appropriate SQL error variables and be
checked by whatever whenever statement is defined.
This commit is contained in:
Michael Meskes
2019-01-30 13:58:25 +01:00
parent e2f731cdba
commit 7ea38f045d
10 changed files with 75 additions and 21 deletions

View File

@ -101,6 +101,11 @@ if (sqlca.sqlcode < 0) exit (1);}
ECPGset_var( 0, &( empl.idnum ), __LINE__);\
/* declare C cursor for select name , accs , byte from empl where idnum = $1 */
#line 36 "binary.pgc"
if (sqlca.sqlcode < 0) exit (1);
#line 36 "binary.pgc"
#line 36 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select name , accs , byte from empl where idnum = $1 ",
@ -135,6 +140,11 @@ if (sqlca.sqlcode < 0) exit (1);}
memset(empl.name, 0, 21L);
ECPGset_var( 1, &( empl.idnum ), __LINE__);\
/* declare B binary cursor for select name , accs , byte from empl where idnum = $1 */
#line 44 "binary.pgc"
if (sqlca.sqlcode < 0) exit (1);
#line 44 "binary.pgc"
#line 44 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare B binary cursor for select name , accs , byte from empl where idnum = $1 ",
@ -172,6 +182,11 @@ if (sqlca.sqlcode < 0) exit (1);}
ECPGset_var( 2, &( empl.idnum ), __LINE__);\
/* declare A binary cursor for select byte from empl where idnum = $1 */
#line 55 "binary.pgc"
if (sqlca.sqlcode < 0) exit (1);
#line 55 "binary.pgc"
#line 55 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare A binary cursor for select byte from empl where idnum = $1 ",