aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/ecpglib')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c15
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c4
-rw-r--r--src/interfaces/ecpg/ecpglib/misc.c7
3 files changed, 15 insertions, 11 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index 5626b0debcf..17d2f8ddf4e 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.23 2004/05/05 15:03:04 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.24 2004/06/27 12:28:39 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -76,7 +76,10 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
* and 0 if not
*/
if (PQgetisnull(results, act_tuple, act_field))
+ {
+ printf("MM NULL\n");
value_for_indicator = -1;
+ }
switch (ind_type)
{
@@ -107,7 +110,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
* Informix has an additional way to specify NULLs
* note that this uses special values to denote NULL
*/
- ECPGset_informix_null(type, var + offset * act_tuple);
+ ECPGset_noind_null(type, var + offset * act_tuple);
}
else
{
@@ -411,7 +414,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (INFORMIX_MODE(compat))
{
/* Informix wants its own NULL value here instead of an error */
- ECPGset_informix_null(ECPGt_numeric, nres);
+ ECPGset_noind_null(ECPGt_numeric, nres);
}
else
{
@@ -454,7 +457,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (INFORMIX_MODE(compat))
{
/* Informix wants its own NULL value here instead of an error */
- ECPGset_informix_null(ECPGt_interval, ires);
+ ECPGset_noind_null(ECPGt_interval, ires);
}
else
{
@@ -493,7 +496,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (INFORMIX_MODE(compat))
{
/* Informix wants its own NULL value here instead of an error */
- ECPGset_informix_null(ECPGt_date, &ddres);
+ ECPGset_noind_null(ECPGt_date, &ddres);
}
else
{
@@ -531,7 +534,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (INFORMIX_MODE(compat))
{
/* Informix wants its own NULL value here instead of an error */
- ECPGset_informix_null(ECPGt_timestamp, &tres);
+ ECPGset_noind_null(ECPGt_timestamp, &tres);
}
else
{
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 2cee7c70c9c..c91e96d3a1a 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.33 2004/05/05 15:03:04 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.34 2004/06/27 12:28:40 meskes Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
@@ -532,7 +532,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
case ECPGt_NO_INDICATOR:
if (stmt->force_indicator == false)
{
- if (ECPGis_informix_null(var->type, var->value))
+ if (ECPGis_noind_null(var->type, var->value))
*tobeinserted_p = "null";
}
break;
diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c
index d2f81a16282..8faf6b2fdff 100644
--- a/src/interfaces/ecpg/ecpglib/misc.c
+++ b/src/interfaces/ecpg/ecpglib/misc.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.20 2004/03/14 14:47:33 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.21 2004/06/27 12:28:40 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -266,7 +266,7 @@ ECPGlog(const char *format,...)
}
void
-ECPGset_informix_null(enum ECPGttype type, void *ptr)
+ECPGset_noind_null(enum ECPGttype type, void *ptr)
{
switch (type)
{
@@ -301,6 +301,7 @@ ECPGset_informix_null(enum ECPGttype type, void *ptr)
break;
case ECPGt_varchar:
*(((struct ECPGgeneric_varchar *) ptr)->arr) = 0x00;
+ ((struct ECPGgeneric_varchar *) ptr)->len = 0;
break;
case ECPGt_decimal:
memset((char *) ptr, 0, sizeof(decimal));
@@ -331,7 +332,7 @@ _check(unsigned char *ptr, int length)
}
bool
-ECPGis_informix_null(enum ECPGttype type, void *ptr)
+ECPGis_noind_null(enum ECPGttype type, void *ptr)
{
switch (type)
{