mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
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:
@ -525,6 +525,17 @@ ECPGset_var(int number, void *pointer, int lineno)
|
||||
{
|
||||
struct var_list *ptr;
|
||||
|
||||
struct sqlca_t *sqlca = ECPGget_sqlca();
|
||||
|
||||
if (sqlca == NULL)
|
||||
{
|
||||
ecpg_raise(lineno, ECPG_OUT_OF_MEMORY,
|
||||
ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
ecpg_init_sqlca(sqlca);
|
||||
|
||||
for (ptr = ivlist; ptr != NULL; ptr = ptr->next)
|
||||
{
|
||||
if (ptr->number == number)
|
||||
|
Reference in New Issue
Block a user