aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/compatlib/informix.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2009-08-14 13:28:22 +0000
committerMichael Meskes <meskes@postgresql.org>2009-08-14 13:28:22 +0000
commitcf37d6846788a7c11b4a2a4500a819c3723d307c (patch)
tree0c0ed17b73f1a8c4f2b4b9357f5f7dcf2ce17bb1 /src/interfaces/ecpg/compatlib/informix.c
parentc74d8a7708d188f06e0c8bdf340847084915138f (diff)
downloadpostgresql-cf37d6846788a7c11b4a2a4500a819c3723d307c.tar.gz
postgresql-cf37d6846788a7c11b4a2a4500a819c3723d307c.zip
Made sure sqlca is reset for declare cursor in Informix mode as pointed out by
Böszörményi Zoltán <zb@cybertec.at>.
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r--src/interfaces/ecpg/compatlib/informix.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index 1118d588dcb..1d447dbe7cf 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -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)
{