1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Made sure sqlca is reset for declare cursor in Informix mode as pointed out by

Böszörményi Zoltán <zb@cybertec.at>.
This commit is contained in:
Michael Meskes
2009-08-14 13:28:22 +00:00
parent c74d8a7708
commit cf37d68467
12 changed files with 135 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.59 2009/06/11 14:49:13 momjian Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.60 2009/08/14 13:28:22 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -16,6 +16,34 @@
#include <sqlca.h>
#include <ecpgerrno.h>
/* this is also defined in ecpglib/misc.c, by defining it twice we don't have to export the symbol */
static struct sqlca_t sqlca_init =
{
{
'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '
},
sizeof(struct sqlca_t),
0,
{
0,
{
0
}
},
{
'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '
},
{
0, 0, 0, 0, 0, 0
},
{
0, 0, 0, 0, 0, 0, 0, 0
},
{
'0', '0', '0', '0', '0'
}
};
static int
deccall2(decimal *arg1, decimal *arg2, int (*ptr) (numeric *, numeric *))
{
@@ -1033,6 +1061,14 @@ ECPG_informix_get_var(int number)
return (ptr) ? ptr->pointer : NULL;
}
void
ECPG_informix_reset_sqlca(void)
{
struct sqlca_t *sqlca = ECPGget_sqlca();
memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
}
int
rsetnull(int t, char *ptr)
{