out-of-scope cursor errors
We seem to have a large portion of the buildfarm red from the ECPG
tests, presumably due to the recently applied out-of-scope cursor patches.
cheers
andrew
Andrew Dunstan �rta:
We seem to have a large portion of the buildfarm red from the ECPG
tests, presumably due to the recently applied out-of-scope cursor
patches.cheers
andrew
Hi.
I know. Patches were already posted for that,
waiting for Michael to review and apply it.
Look at the commitfest page.
Best regards,
Zolt�n B�sz�rm�nyi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zolt�n B�sz�rm�nyi
Cybertec Sch�nig & Sch�nig GmbH
http://www.postgresql.at/
On Fri, Jan 29, 2010 at 06:32:20AM +0100, Boszormenyi Zoltan wrote:
I know. Patches were already posted for that,
waiting for Michael to review and apply it.
Just came back from another trip. Patch works on my system, so I committed it.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
Michael Meskes írta:
On Fri, Jan 29, 2010 at 06:32:20AM +0100, Boszormenyi Zoltan wrote:
I know. Patches were already posted for that,
waiting for Michael to review and apply it.Just came back from another trip. Patch works on my system, so I committed it.
Michael
Thanks. Hopefully that will make the buildfarm green from this problem.
As you might have noticed, the fix you just committed deleted the test
for NaN in the outofscope.pgc regression test, which I tried to fix
separately.
The buildfarm revealed a problem with NaN/Inf handling, like:
- Windows (and mybe others) don't accept "NaN" in strtod()
- different UNIX(-like) platforms write out different strings in printf()
for a double variable storing. NaN. E.g.: Linux: "nan",
Solaris: "NaN", AIX: "NaNQ"
Can you also review the NaN/Infinity patch, too? This fix uses
the same methods as the backend, i.e. looking for special strings
and attempt to handle them in a portable way. There is one
possible problem regarding NaNs and risnull()/rsetnull():
I had to introduce a new symbol (NUMERIC_NULL) for
handling NULL inline in the numeric value itself.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Boszormenyi Zoltan írta:
- different UNIX(-like) platforms write out different strings in printf()
for a double variable storing. NaN. E.g.: Linux: "nan",
Solaris: "NaN", AIX: "NaNQ"
After I sent it and reread my mail, I realized that my fix
wouldn't be enough because of the above: ECPG uses sprintf()
for float and double, and just like in the backend, a common
code to send "NaN" and +/- "Infinity" to the server is needed.
New patch is attached.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Attachments:
pg85-ecpg-fix-nan-inf-4-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-4-ctxdiff.patchDownload
diff -dcrpN pgsql.orig/src/interfaces/ecpg/ecpglib/data.c pgsql.1/src/interfaces/ecpg/ecpglib/data.c
*** pgsql.orig/src/interfaces/ecpg/ecpglib/data.c 2010-01-01 14:11:38.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/ecpglib/data.c 2010-01-28 21:36:16.000000000 +0100
***************
*** 5,10 ****
--- 5,11 ----
#include <stdlib.h>
#include <string.h>
+ #include <math.h>
#include "ecpgtype.h"
#include "ecpglib.h"
*************** garbage_left(enum ARRAY_TYPE isarray, ch
*** 38,43 ****
--- 39,96 ----
return false;
}
+ /* stolen code from src/backend/utils/adt/float.c */
+ #if defined(WIN32) && !defined(NAN)
+ static const uint32 nan[2] = {0xffffffff, 0x7fffffff};
+
+ #define NAN (*(const double *) nan)
+ #endif
+
+ static double
+ get_float8_infinity(void)
+ {
+ #ifdef INFINITY
+ return (double) INFINITY;
+ #else
+ return (double) (HUGE_VAL * HUGE_VAL);
+ #endif
+ }
+
+ static double
+ get_float8_nan(void)
+ {
+ #ifdef NAN
+ return (double) NAN;
+ #else
+ return (double) (0.0 / 0.0);
+ #endif
+ }
+
+ static bool
+ check_special_value(char *ptr, double *retval, char **endptr)
+ {
+ if (!pg_strncasecmp(ptr, "NaN", 3))
+ {
+ *retval = get_float8_nan();
+ *endptr = ptr + 3;
+ return true;
+ }
+ else if (!pg_strncasecmp(ptr, "Infinity", 8))
+ {
+ *retval = get_float8_infinity();
+ *endptr = ptr + 8;
+ return true;
+ }
+ else if (!pg_strncasecmp(ptr, "-Infinity", 9))
+ {
+ *retval = -get_float8_infinity();
+ *endptr = ptr + 9;
+ return true;
+ }
+
+ return false;
+ }
+
bool
ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
enum ECPGttype type, enum ECPGttype ind_type,
*************** ecpg_get_data(const PGresult *results, i
*** 300,307 ****
case ECPGt_float:
case ECPGt_double:
if (isarray && *pval == '"')
! dres = strtod(pval + 1, &scan_length);
! else
dres = strtod(pval, &scan_length);
if (isarray && *scan_length == '"')
--- 353,361 ----
case ECPGt_float:
case ECPGt_double:
if (isarray && *pval == '"')
! pval++;
!
! if (!check_special_value(pval, &dres, &scan_length))
dres = strtod(pval, &scan_length);
if (isarray && *scan_length == '"')
diff -dcrpN pgsql.orig/src/interfaces/ecpg/ecpglib/execute.c pgsql.1/src/interfaces/ecpg/ecpglib/execute.c
*** pgsql.orig/src/interfaces/ecpg/ecpglib/execute.c 2010-01-22 19:02:20.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/ecpglib/execute.c 2010-01-30 10:52:54.000000000 +0100
***************
*** 17,22 ****
--- 17,23 ----
#include "postgres_fe.h"
#include <locale.h>
+ #include <math.h>
#include "pg_type.h"
*************** ecpg_store_result(const PGresult *result
*** 463,468 ****
--- 464,501 ----
return status;
}
+ static void
+ sprintf_double_value(char *ptr, double value, const char *delim)
+ {
+ if (isinf(value))
+ {
+ if (value < 0)
+ sprintf(ptr, "%s%s", "-Infinity", delim);
+ else
+ sprintf(ptr, "%s%s", "Infinity", delim);
+ }
+ else if (isnan(value))
+ sprintf(ptr, "%s%s", "NaN", delim);
+ else
+ sprintf(ptr, "%.14g%s", value, delim);
+ }
+
+ static void
+ sprintf_float_value(char *ptr, float value, const char *delim)
+ {
+ if (isinf(value))
+ {
+ if (value < 0)
+ sprintf(ptr, "%s%s", "-Infinity", delim);
+ else
+ sprintf(ptr, "%s%s", "Infinity", delim);
+ }
+ else if (isnan(value))
+ sprintf(ptr, "%s%s", "NaN", delim);
+ else
+ sprintf(ptr, "%.14g%s", value, delim);
+ }
+
bool
ecpg_store_input(const int lineno, const bool force_indicator, const struct variable * var,
char **tobeinserted_p, bool quote)
*************** ecpg_store_input(const int lineno, const
*** 693,704 ****
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((float *) var->value)[element]);
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf(mallocedval, "%.14g", *((float *) var->value));
*tobeinserted_p = mallocedval;
break;
--- 726,737 ----
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf_float_value(mallocedval + strlen(mallocedval), ((float *) var->value)[element], ",");
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf_float_value(mallocedval, *((float *) var->value), "");
*tobeinserted_p = mallocedval;
break;
*************** ecpg_store_input(const int lineno, const
*** 712,723 ****
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((double *) var->value)[element]);
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf(mallocedval, "%.14g", *((double *) var->value));
*tobeinserted_p = mallocedval;
break;
--- 745,756 ----
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf_double_value(mallocedval + strlen(mallocedval), ((double *) var->value)[element], ",");
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf_double_value(mallocedval, *((double *) var->value), "");
*tobeinserted_p = mallocedval;
break;
diff -dcrpN pgsql.orig/src/interfaces/ecpg/ecpglib/misc.c pgsql.1/src/interfaces/ecpg/ecpglib/misc.c
*** pgsql.orig/src/interfaces/ecpg/ecpglib/misc.c 2010-01-26 10:09:40.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/ecpglib/misc.c 2010-01-28 21:53:44.000000000 +0100
*************** ECPGset_noind_null(enum ECPGttype type,
*** 344,354 ****
break;
case ECPGt_decimal:
memset((char *) ptr, 0, sizeof(decimal));
! ((decimal *) ptr)->sign = NUMERIC_NAN;
break;
case ECPGt_numeric:
memset((char *) ptr, 0, sizeof(numeric));
! ((numeric *) ptr)->sign = NUMERIC_NAN;
break;
case ECPGt_interval:
memset((char *) ptr, 0xff, sizeof(interval));
--- 344,354 ----
break;
case ECPGt_decimal:
memset((char *) ptr, 0, sizeof(decimal));
! ((decimal *) ptr)->sign = NUMERIC_NULL;
break;
case ECPGt_numeric:
memset((char *) ptr, 0, sizeof(numeric));
! ((numeric *) ptr)->sign = NUMERIC_NULL;
break;
case ECPGt_interval:
memset((char *) ptr, 0xff, sizeof(interval));
*************** ECPGis_noind_null(enum ECPGttype type, v
*** 416,426 ****
return true;
break;
case ECPGt_decimal:
! if (((decimal *) ptr)->sign == NUMERIC_NAN)
return true;
break;
case ECPGt_numeric:
! if (((numeric *) ptr)->sign == NUMERIC_NAN)
return true;
break;
case ECPGt_interval:
--- 416,426 ----
return true;
break;
case ECPGt_decimal:
! if (((decimal *) ptr)->sign == NUMERIC_NULL)
return true;
break;
case ECPGt_numeric:
! if (((numeric *) ptr)->sign == NUMERIC_NULL)
return true;
break;
case ECPGt_interval:
diff -dcrpN pgsql.orig/src/interfaces/ecpg/include/pgtypes_numeric.h pgsql.1/src/interfaces/ecpg/include/pgtypes_numeric.h
*** pgsql.orig/src/interfaces/ecpg/include/pgtypes_numeric.h 2010-01-06 08:43:28.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/include/pgtypes_numeric.h 2010-01-28 22:01:00.000000000 +0100
***************
*** 4,9 ****
--- 4,10 ----
#define NUMERIC_POS 0x0000
#define NUMERIC_NEG 0x4000
#define NUMERIC_NAN 0xC000
+ #define NUMERIC_NULL 0xF000
#define NUMERIC_MAX_PRECISION 1000
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
#define NUMERIC_MIN_DISPLAY_SCALE 0
diff -dcrpN pgsql.orig/src/interfaces/ecpg/pgtypeslib/numeric.c pgsql.1/src/interfaces/ecpg/pgtypeslib/numeric.c
*** pgsql.orig/src/interfaces/ecpg/pgtypeslib/numeric.c 2009-09-03 12:25:47.000000000 +0200
--- pgsql.1/src/interfaces/ecpg/pgtypeslib/numeric.c 2010-01-28 22:32:31.000000000 +0100
*************** set_var_from_str(char *str, char **ptr,
*** 173,178 ****
--- 173,197 ----
(*ptr)++;
}
+ if (pg_strncasecmp(*ptr, "NaN", 3) == 0)
+ {
+ *ptr += 3;
+ dest->sign = NUMERIC_NAN;
+
+ /* Should be nothing left but spaces */
+ while (*(*ptr))
+ {
+ if (!isspace((unsigned char) *(*ptr)))
+ {
+ errno = PGTYPES_NUM_BAD_NUMERIC;
+ return -1;
+ }
+ (*ptr)++;
+ }
+
+ return 0;
+ }
+
if (alloc_var(dest, strlen((*ptr))) < 0)
return -1;
dest->weight = -1;
*************** get_str_from_var(numeric *var, int dscal
*** 296,301 ****
--- 315,329 ----
int i;
int d;
+ if (var->sign == NUMERIC_NAN)
+ {
+ str = (char *) pgtypes_alloc(4);
+ if (str == NULL)
+ return NULL;
+ sprintf(str, "NaN");
+ return str;
+ }
+
/*
* Check if we must round up before printing the value and do so.
*/
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/ecpg_schedule pgsql.1/src/interfaces/ecpg/test/ecpg_schedule
*** pgsql.orig/src/interfaces/ecpg/test/ecpg_schedule 2010-01-26 10:09:40.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/ecpg_schedule 2010-01-28 21:24:11.000000000 +0100
*************** test: pgtypeslib/dt_test
*** 15,20 ****
--- 15,21 ----
test: pgtypeslib/dt_test2
test: pgtypeslib/num_test
test: pgtypeslib/num_test2
+ test: pgtypeslib/nan_test
test: preproc/array_of_struct
test: preproc/autoprep
test: preproc/comment
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/ecpg_schedule_tcp pgsql.1/src/interfaces/ecpg/test/ecpg_schedule_tcp
*** pgsql.orig/src/interfaces/ecpg/test/ecpg_schedule_tcp 2010-01-26 10:09:40.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/ecpg_schedule_tcp 2010-01-28 21:24:19.000000000 +0100
*************** test: pgtypeslib/dt_test
*** 15,20 ****
--- 15,21 ----
test: pgtypeslib/dt_test2
test: pgtypeslib/num_test
test: pgtypeslib/num_test2
+ test: pgtypeslib/nan_test
test: preproc/array_of_struct
test: preproc/autoprep
test: preproc/comment
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-01-29 18:27:06.000000000 +0100
***************
*** 0 ****
--- 1,263 ----
+ /* Processed by ecpg (regression mode) */
+ /* These include files are added by the preprocessor */
+ #include <ecpglib.h>
+ #include <ecpgerrno.h>
+ #include <sqlca.h>
+ /* End of automatic include section */
+ #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
+
+ #line 1 "nan_test.pgc"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+ #include <pgtypes_numeric.h>
+ #include <decimal.h>
+
+
+ #line 1 "regression.h"
+
+
+
+
+
+
+ #line 7 "nan_test.pgc"
+
+
+ int
+ main(void)
+ {
+ /* exec sql begin declare section */
+
+
+
+
+
+ #line 13 "nan_test.pgc"
+ int id ;
+
+ #line 14 "nan_test.pgc"
+ double d ;
+
+ #line 15 "nan_test.pgc"
+ numeric * num ;
+
+ #line 16 "nan_test.pgc"
+ char val [ 16 ] ;
+ /* exec sql end declare section */
+ #line 17 "nan_test.pgc"
+
+
+ ECPGdebug(1, stderr);
+ /* exec sql whenever sqlerror do sqlprint ( ) ; */
+ #line 20 "nan_test.pgc"
+
+
+ { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ #line 22 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 22 "nan_test.pgc"
+
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest1 ( id int4 , d float8 )", ECPGt_EOIT, ECPGt_EORT);
+ #line 24 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 24 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'inf' :: float8 ) , ( 3 , '-inf' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
+ #line 25 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 25 "nan_test.pgc"
+
+
+ /* declare cur cursor for select id , d , d from nantest1 */
+ #line 27 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+ #line 28 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 28 "nan_test.pgc"
+
+ while (1)
+ {
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 31 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 31 "nan_test.pgc"
+
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 3 , $2 )",
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 39 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 39 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )",
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 40 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 40 "nan_test.pgc"
+
+ }
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
+ #line 42 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 42 "nan_test.pgc"
+
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+ #line 44 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 44 "nan_test.pgc"
+
+ while (1)
+ {
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 47 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 47 "nan_test.pgc"
+
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+ }
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
+ #line 55 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 55 "nan_test.pgc"
+
+
+ num = PGTYPESnumeric_new();
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest2 ( id int4 , d numeric )", ECPGt_EOIT, ECPGt_EORT);
+ #line 59 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 59 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )", ECPGt_EOIT, ECPGt_EORT);
+ #line 60 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 60 "nan_test.pgc"
+
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select id , d , d from nantest2 where id = 4", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 62 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 62 "nan_test.pgc"
+
+
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 5 , $1 )",
+ ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 66 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 66 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 6 , $1 )",
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 67 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 67 "nan_test.pgc"
+
+
+ /* declare cur1 cursor for select id , d , d from nantest2 */
+ #line 69 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
+ #line 70 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 70 "nan_test.pgc"
+
+ while (1)
+ {
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur1", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 73 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 73 "nan_test.pgc"
+
+ if (sqlca.sqlcode)
+ break;
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+ }
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
+ #line 78 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 78 "nan_test.pgc"
+
+
+ { ECPGtrans(__LINE__, NULL, "rollback");
+ #line 80 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 80 "nan_test.pgc"
+
+ { ECPGdisconnect(__LINE__, "CURRENT");
+ #line 81 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 81 "nan_test.pgc"
+
+
+ return (0);
+ }
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 2010-01-29 18:27:06.000000000 +0100
***************
*** 0 ****
--- 1,360 ----
+ [NO_PID]: ECPGdebug: set to 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 24: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 24: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 24: OK: CREATE TABLE
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 25: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'inf' :: float8 ) , ( 3 , '-inf' :: float8 ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 25: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 25: OK: INSERT 0 3
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 28: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 28: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 28: OK: DECLARE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: 1 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 1 = 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 2 = nan
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 1 = 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 2 = NaN
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: 2 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 1 = 2
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 2 = inf
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 1 = 2
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 2 = Infinity
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: 3 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 1 = 3
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 2 = -inf
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 1 = 3
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 2 = -Infinity
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 0 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: raising sqlcode 100 on line 31: no data found on line 31
+ [NO_PID]: sqlca: code: 100, state: 02000
+ [NO_PID]: ecpg_execute on line 42: query: close cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 42: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 42: OK: CLOSE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 44: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 44: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 44: OK: DECLARE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 1 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 2 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 3 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 4 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 7 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 5 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 8 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 6 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 9 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 0 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: raising sqlcode 100 on line 47: no data found on line 47
+ [NO_PID]: sqlca: code: 100, state: 02000
+ [NO_PID]: ecpg_execute on line 55: query: close cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 55: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 55: OK: CLOSE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 59: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 59: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 59: OK: CREATE TABLE
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 60: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 60: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 60: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 62: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 62: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 62: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 62: RESULT: 4 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 62: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 62: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 66: query: insert into nantest2 ( id , d ) values ( 5 , $1 ); with 1 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 66: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 66: parameter 1 = NaN
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 66: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 67: query: insert into nantest2 ( id , d ) values ( 6 , $1 ); with 1 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 67: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 67: parameter 1 = NaN
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 67: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 70: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 70: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 70: OK: DECLARE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: 4 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: 5 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: 6 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 0 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: raising sqlcode 100 on line 73: no data found on line 73
+ [NO_PID]: sqlca: code: 100, state: 02000
+ [NO_PID]: ecpg_execute on line 78: query: close cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 78: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 78: OK: CLOSE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ECPGtrans on line 80: action "rollback"; connection "regress1"
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_finish: connection regress1 closed
+ [NO_PID]: sqlca: code: 0, state: 00000
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout 2010-01-29 18:27:07.000000000 +0100
***************
*** 0 ****
--- 1,16 ----
+ 1 NaN 'NaN'
+ 2 +Inf 'Infinity'
+ 3 -Inf '-Infinity'
+ 1 NaN 'NaN'
+ 2 +Inf 'Infinity'
+ 3 -Inf '-Infinity'
+ 4 NaN 'NaN'
+ 7 NaN 'NaN'
+ 5 +Inf 'Infinity'
+ 8 +Inf 'Infinity'
+ 6 -Inf '-Infinity'
+ 9 -Inf '-Infinity'
+ 4 NaN 'NaN'
+ 4 NaN 'NaN'
+ 5 NaN 'NaN'
+ 6 NaN 'NaN'
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.c pgsql.1/src/interfaces/ecpg/test/expected/preproc-outofscope.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.c 2010-01-26 11:31:14.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/preproc-outofscope.c 2010-01-28 22:41:06.000000000 +0100
***************
*** 31,36 ****
--- 31,37 ----
#define NUMERIC_POS 0x0000
#define NUMERIC_NEG 0x4000
#define NUMERIC_NAN 0xC000
+ #define NUMERIC_NULL 0xF000
#define NUMERIC_MAX_PRECISION 1000
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
#define NUMERIC_MIN_DISPLAY_SCALE 0
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/sql-sqlda.c pgsql.1/src/interfaces/ecpg/test/expected/sql-sqlda.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/sql-sqlda.c 2010-01-06 19:06:44.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/sql-sqlda.c 2010-01-28 22:41:07.000000000 +0100
*************** typedef struct sqlda_struct sqlda_t;
*** 53,58 ****
--- 53,59 ----
#define NUMERIC_POS 0x0000
#define NUMERIC_NEG 0x4000
#define NUMERIC_NAN 0xC000
+ #define NUMERIC_NULL 0xF000
#define NUMERIC_MAX_PRECISION 1000
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
#define NUMERIC_MIN_DISPLAY_SCALE 0
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/Makefile pgsql.1/src/interfaces/ecpg/test/pgtypeslib/Makefile
*** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/Makefile 2006-08-13 12:18:31.000000000 +0200
--- pgsql.1/src/interfaces/ecpg/test/pgtypeslib/Makefile 2010-01-28 21:23:46.000000000 +0100
*************** include $(top_srcdir)/$(subdir)/../Makef
*** 6,12 ****
TESTS = dt_test dt_test.c \
dt_test2 dt_test2.c \
num_test num_test.c \
! num_test2 num_test2.c
all: $(TESTS)
--- 6,13 ----
TESTS = dt_test dt_test.c \
dt_test2 dt_test2.c \
num_test num_test.c \
! num_test2 num_test2.c \
! nan_test nan_test.c
all: $(TESTS)
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql.1/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
*** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-01-29 15:38:30.000000000 +0100
***************
*** 0 ****
--- 1,84 ----
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+ #include <pgtypes_numeric.h>
+ #include <decimal.h>
+
+ exec sql include ../regression;
+
+ int
+ main(void)
+ {
+ exec sql begin declare section;
+ int id;
+ double d;
+ numeric *num;
+ char val[16];
+ exec sql end declare section;
+
+ ECPGdebug(1, stderr);
+ exec sql whenever sqlerror do sqlprint();
+
+ exec sql connect to REGRESSDB1;
+
+ exec sql create table nantest1 (id int4, d float8);
+ exec sql insert into nantest1 (id, d) values (1, 'nan'::float8), (2, 'inf'::float8), (3, '-inf'::float8);
+
+ exec sql declare cur cursor for select id, d, d from nantest1;
+ exec sql open cur;
+ while (1)
+ {
+ exec sql fetch from cur into :id, :d, :val;
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+
+ exec sql insert into nantest1 (id, d) values (:id + 3, :d);
+ exec sql insert into nantest1 (id, d) values (:id + 6, :val);
+ }
+ exec sql close cur;
+
+ exec sql open cur;
+ while (1)
+ {
+ exec sql fetch from cur into :id, :d, :val;
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+ }
+ exec sql close cur;
+
+ num = PGTYPESnumeric_new();
+
+ exec sql create table nantest2 (id int4, d numeric);
+ exec sql insert into nantest2 (id, d) values (4, 'nan'::numeric);
+
+ exec sql select id, d, d into :id, :num, :val from nantest2 where id = 4;
+
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+
+ exec sql insert into nantest2 (id, d) values (5, :num);
+ exec sql insert into nantest2 (id, d) values (6, :val);
+
+ exec sql declare cur1 cursor for select id, d, d from nantest2;
+ exec sql open cur1;
+ while (1)
+ {
+ exec sql fetch from cur1 into :id, :num, :val;
+ if (sqlca.sqlcode)
+ break;
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+ }
+ exec sql close cur1;
+
+ exec sql rollback;
+ exec sql disconnect;
+
+ return (0);
+ }
On Sat, Jan 30, 2010 at 11:09:34AM +0100, Boszormenyi Zoltan wrote:
After I sent it and reread my mail, I realized that my fix
wouldn't be enough because of the above: ECPG uses sprintf()
for float and double, and just like in the backend, a common
code to send "NaN" and +/- "Infinity" to the server is needed.
New patch is attached.
Does it work for you? I get regression test failures. Haven't looked into the
function yet though.
*** /home/michael/technik/sources/archive/postgresql/pgsql/src/interfaces/ecpg.nan/test/expected/pgtypeslib-nan_test.stderr 2010-02-02 14:10:30.000000000 +0100
--- /home/michael/technik/sources/archive/postgresql/pgsql/src/interfaces/ecpg.nan/test/results/pgtypeslib-nan_test.stderr 2010-02-02 15:11:17.000000000 +0100
***************
*** 38,44 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: free_params on line 39: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 39: parameter 2 = nan
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
--- 38,44 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: free_params on line 39: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 39: parameter 2 = NaN
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
***************
*** 70,76 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: free_params on line 39: parameter 1 = 2
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 39: parameter 2 = inf
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
--- 70,76 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: free_params on line 39: parameter 1 = 2
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 39: parameter 2 = Infinity
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
***************
*** 102,108 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: free_params on line 39: parameter 1 = 3
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 39: parameter 2 = -inf
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
--- 102,108 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: free_params on line 39: parameter 1 = 3
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 39: parameter 2 = -Infinity
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
======================================================================
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
Michael Meskes írta:
On Sat, Jan 30, 2010 at 11:09:34AM +0100, Boszormenyi Zoltan wrote:
After I sent it and reread my mail, I realized that my fix
wouldn't be enough because of the above: ECPG uses sprintf()
for float and double, and just like in the backend, a common
code to send "NaN" and +/- "Infinity" to the server is needed.
New patch is attached.Does it work for you? I get regression test failures. Haven't looked into the
function yet though.
Arggg. I didn't update the regression test's stderr.
Actually, I didn't do "make install" before running "make check"
and the target directory had the libraries with my previous changeset.
The diff you quoted reflects the last change. Result of
double d; /* contains NaN or +/- INF */
printf("%lf", d);
is platform-dependent, the new string is
"fixed" across all platforms.
Here's the new patch with the updated regression test.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Attachments:
pg85-ecpg-fix-nan-inf-5-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-5-ctxdiff.patchDownload
diff -dcrpN pgsql/src/interfaces/ecpg/ecpglib/data.c pgsql.1/src/interfaces/ecpg/ecpglib/data.c
*** pgsql/src/interfaces/ecpg/ecpglib/data.c 2010-01-01 14:11:38.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/ecpglib/data.c 2010-02-02 15:22:01.000000000 +0100
***************
*** 5,10 ****
--- 5,11 ----
#include <stdlib.h>
#include <string.h>
+ #include <math.h>
#include "ecpgtype.h"
#include "ecpglib.h"
*************** garbage_left(enum ARRAY_TYPE isarray, ch
*** 38,43 ****
--- 39,96 ----
return false;
}
+ /* stolen code from src/backend/utils/adt/float.c */
+ #if defined(WIN32) && !defined(NAN)
+ static const uint32 nan[2] = {0xffffffff, 0x7fffffff};
+
+ #define NAN (*(const double *) nan)
+ #endif
+
+ static double
+ get_float8_infinity(void)
+ {
+ #ifdef INFINITY
+ return (double) INFINITY;
+ #else
+ return (double) (HUGE_VAL * HUGE_VAL);
+ #endif
+ }
+
+ static double
+ get_float8_nan(void)
+ {
+ #ifdef NAN
+ return (double) NAN;
+ #else
+ return (double) (0.0 / 0.0);
+ #endif
+ }
+
+ static bool
+ check_special_value(char *ptr, double *retval, char **endptr)
+ {
+ if (!pg_strncasecmp(ptr, "NaN", 3))
+ {
+ *retval = get_float8_nan();
+ *endptr = ptr + 3;
+ return true;
+ }
+ else if (!pg_strncasecmp(ptr, "Infinity", 8))
+ {
+ *retval = get_float8_infinity();
+ *endptr = ptr + 8;
+ return true;
+ }
+ else if (!pg_strncasecmp(ptr, "-Infinity", 9))
+ {
+ *retval = -get_float8_infinity();
+ *endptr = ptr + 9;
+ return true;
+ }
+
+ return false;
+ }
+
bool
ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
enum ECPGttype type, enum ECPGttype ind_type,
*************** ecpg_get_data(const PGresult *results, i
*** 300,307 ****
case ECPGt_float:
case ECPGt_double:
if (isarray && *pval == '"')
! dres = strtod(pval + 1, &scan_length);
! else
dres = strtod(pval, &scan_length);
if (isarray && *scan_length == '"')
--- 353,361 ----
case ECPGt_float:
case ECPGt_double:
if (isarray && *pval == '"')
! pval++;
!
! if (!check_special_value(pval, &dres, &scan_length))
dres = strtod(pval, &scan_length);
if (isarray && *scan_length == '"')
diff -dcrpN pgsql/src/interfaces/ecpg/ecpglib/execute.c pgsql.1/src/interfaces/ecpg/ecpglib/execute.c
*** pgsql/src/interfaces/ecpg/ecpglib/execute.c 2010-01-29 17:21:42.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/ecpglib/execute.c 2010-02-02 15:22:01.000000000 +0100
***************
*** 17,22 ****
--- 17,23 ----
#include "postgres_fe.h"
#include <locale.h>
+ #include <math.h>
#include "pg_type.h"
*************** ecpg_store_result(const PGresult *result
*** 463,468 ****
--- 464,501 ----
return status;
}
+ static void
+ sprintf_double_value(char *ptr, double value, const char *delim)
+ {
+ if (isinf(value))
+ {
+ if (value < 0)
+ sprintf(ptr, "%s%s", "-Infinity", delim);
+ else
+ sprintf(ptr, "%s%s", "Infinity", delim);
+ }
+ else if (isnan(value))
+ sprintf(ptr, "%s%s", "NaN", delim);
+ else
+ sprintf(ptr, "%.14g%s", value, delim);
+ }
+
+ static void
+ sprintf_float_value(char *ptr, float value, const char *delim)
+ {
+ if (isinf(value))
+ {
+ if (value < 0)
+ sprintf(ptr, "%s%s", "-Infinity", delim);
+ else
+ sprintf(ptr, "%s%s", "Infinity", delim);
+ }
+ else if (isnan(value))
+ sprintf(ptr, "%s%s", "NaN", delim);
+ else
+ sprintf(ptr, "%.14g%s", value, delim);
+ }
+
bool
ecpg_store_input(const int lineno, const bool force_indicator, const struct variable * var,
char **tobeinserted_p, bool quote)
*************** ecpg_store_input(const int lineno, const
*** 693,704 ****
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((float *) var->value)[element]);
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf(mallocedval, "%.14g", *((float *) var->value));
*tobeinserted_p = mallocedval;
break;
--- 726,737 ----
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf_float_value(mallocedval + strlen(mallocedval), ((float *) var->value)[element], ",");
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf_float_value(mallocedval, *((float *) var->value), "");
*tobeinserted_p = mallocedval;
break;
*************** ecpg_store_input(const int lineno, const
*** 712,723 ****
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf(mallocedval + strlen(mallocedval), "%.14g,", ((double *) var->value)[element]);
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf(mallocedval, "%.14g", *((double *) var->value));
*tobeinserted_p = mallocedval;
break;
--- 745,756 ----
strcpy(mallocedval, "array [");
for (element = 0; element < asize; element++)
! sprintf_double_value(mallocedval + strlen(mallocedval), ((double *) var->value)[element], ",");
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
else
! sprintf_double_value(mallocedval, *((double *) var->value), "");
*tobeinserted_p = mallocedval;
break;
diff -dcrpN pgsql/src/interfaces/ecpg/ecpglib/misc.c pgsql.1/src/interfaces/ecpg/ecpglib/misc.c
*** pgsql/src/interfaces/ecpg/ecpglib/misc.c 2010-01-26 10:09:40.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/ecpglib/misc.c 2010-02-02 15:22:01.000000000 +0100
*************** ECPGset_noind_null(enum ECPGttype type,
*** 344,354 ****
break;
case ECPGt_decimal:
memset((char *) ptr, 0, sizeof(decimal));
! ((decimal *) ptr)->sign = NUMERIC_NAN;
break;
case ECPGt_numeric:
memset((char *) ptr, 0, sizeof(numeric));
! ((numeric *) ptr)->sign = NUMERIC_NAN;
break;
case ECPGt_interval:
memset((char *) ptr, 0xff, sizeof(interval));
--- 344,354 ----
break;
case ECPGt_decimal:
memset((char *) ptr, 0, sizeof(decimal));
! ((decimal *) ptr)->sign = NUMERIC_NULL;
break;
case ECPGt_numeric:
memset((char *) ptr, 0, sizeof(numeric));
! ((numeric *) ptr)->sign = NUMERIC_NULL;
break;
case ECPGt_interval:
memset((char *) ptr, 0xff, sizeof(interval));
*************** ECPGis_noind_null(enum ECPGttype type, v
*** 416,426 ****
return true;
break;
case ECPGt_decimal:
! if (((decimal *) ptr)->sign == NUMERIC_NAN)
return true;
break;
case ECPGt_numeric:
! if (((numeric *) ptr)->sign == NUMERIC_NAN)
return true;
break;
case ECPGt_interval:
--- 416,426 ----
return true;
break;
case ECPGt_decimal:
! if (((decimal *) ptr)->sign == NUMERIC_NULL)
return true;
break;
case ECPGt_numeric:
! if (((numeric *) ptr)->sign == NUMERIC_NULL)
return true;
break;
case ECPGt_interval:
diff -dcrpN pgsql/src/interfaces/ecpg/include/pgtypes_numeric.h pgsql.1/src/interfaces/ecpg/include/pgtypes_numeric.h
*** pgsql/src/interfaces/ecpg/include/pgtypes_numeric.h 2010-01-06 08:43:28.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/include/pgtypes_numeric.h 2010-02-02 15:22:01.000000000 +0100
***************
*** 4,9 ****
--- 4,10 ----
#define NUMERIC_POS 0x0000
#define NUMERIC_NEG 0x4000
#define NUMERIC_NAN 0xC000
+ #define NUMERIC_NULL 0xF000
#define NUMERIC_MAX_PRECISION 1000
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
#define NUMERIC_MIN_DISPLAY_SCALE 0
diff -dcrpN pgsql/src/interfaces/ecpg/pgtypeslib/numeric.c pgsql.1/src/interfaces/ecpg/pgtypeslib/numeric.c
*** pgsql/src/interfaces/ecpg/pgtypeslib/numeric.c 2009-09-03 12:25:47.000000000 +0200
--- pgsql.1/src/interfaces/ecpg/pgtypeslib/numeric.c 2010-02-02 15:22:01.000000000 +0100
*************** set_var_from_str(char *str, char **ptr,
*** 173,178 ****
--- 173,197 ----
(*ptr)++;
}
+ if (pg_strncasecmp(*ptr, "NaN", 3) == 0)
+ {
+ *ptr += 3;
+ dest->sign = NUMERIC_NAN;
+
+ /* Should be nothing left but spaces */
+ while (*(*ptr))
+ {
+ if (!isspace((unsigned char) *(*ptr)))
+ {
+ errno = PGTYPES_NUM_BAD_NUMERIC;
+ return -1;
+ }
+ (*ptr)++;
+ }
+
+ return 0;
+ }
+
if (alloc_var(dest, strlen((*ptr))) < 0)
return -1;
dest->weight = -1;
*************** get_str_from_var(numeric *var, int dscal
*** 296,301 ****
--- 315,329 ----
int i;
int d;
+ if (var->sign == NUMERIC_NAN)
+ {
+ str = (char *) pgtypes_alloc(4);
+ if (str == NULL)
+ return NULL;
+ sprintf(str, "NaN");
+ return str;
+ }
+
/*
* Check if we must round up before printing the value and do so.
*/
diff -dcrpN pgsql/src/interfaces/ecpg/test/ecpg_schedule pgsql.1/src/interfaces/ecpg/test/ecpg_schedule
*** pgsql/src/interfaces/ecpg/test/ecpg_schedule 2010-01-26 10:09:40.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/ecpg_schedule 2010-02-02 15:22:01.000000000 +0100
*************** test: pgtypeslib/dt_test
*** 15,20 ****
--- 15,21 ----
test: pgtypeslib/dt_test2
test: pgtypeslib/num_test
test: pgtypeslib/num_test2
+ test: pgtypeslib/nan_test
test: preproc/array_of_struct
test: preproc/autoprep
test: preproc/comment
diff -dcrpN pgsql/src/interfaces/ecpg/test/ecpg_schedule_tcp pgsql.1/src/interfaces/ecpg/test/ecpg_schedule_tcp
*** pgsql/src/interfaces/ecpg/test/ecpg_schedule_tcp 2010-01-26 10:09:40.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/ecpg_schedule_tcp 2010-02-02 15:22:01.000000000 +0100
*************** test: pgtypeslib/dt_test
*** 15,20 ****
--- 15,21 ----
test: pgtypeslib/dt_test2
test: pgtypeslib/num_test
test: pgtypeslib/num_test2
+ test: pgtypeslib/nan_test
test: preproc/array_of_struct
test: preproc/autoprep
test: preproc/comment
diff -dcrpN pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
*** pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-02 15:22:01.000000000 +0100
***************
*** 0 ****
--- 1,263 ----
+ /* Processed by ecpg (regression mode) */
+ /* These include files are added by the preprocessor */
+ #include <ecpglib.h>
+ #include <ecpgerrno.h>
+ #include <sqlca.h>
+ /* End of automatic include section */
+ #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
+
+ #line 1 "nan_test.pgc"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+ #include <pgtypes_numeric.h>
+ #include <decimal.h>
+
+
+ #line 1 "regression.h"
+
+
+
+
+
+
+ #line 7 "nan_test.pgc"
+
+
+ int
+ main(void)
+ {
+ /* exec sql begin declare section */
+
+
+
+
+
+ #line 13 "nan_test.pgc"
+ int id ;
+
+ #line 14 "nan_test.pgc"
+ double d ;
+
+ #line 15 "nan_test.pgc"
+ numeric * num ;
+
+ #line 16 "nan_test.pgc"
+ char val [ 16 ] ;
+ /* exec sql end declare section */
+ #line 17 "nan_test.pgc"
+
+
+ ECPGdebug(1, stderr);
+ /* exec sql whenever sqlerror do sqlprint ( ) ; */
+ #line 20 "nan_test.pgc"
+
+
+ { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
+ #line 22 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 22 "nan_test.pgc"
+
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest1 ( id int4 , d float8 )", ECPGt_EOIT, ECPGt_EORT);
+ #line 24 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 24 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'inf' :: float8 ) , ( 3 , '-inf' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
+ #line 25 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 25 "nan_test.pgc"
+
+
+ /* declare cur cursor for select id , d , d from nantest1 */
+ #line 27 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+ #line 28 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 28 "nan_test.pgc"
+
+ while (1)
+ {
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 31 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 31 "nan_test.pgc"
+
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 3 , $2 )",
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 39 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 39 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )",
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 40 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 40 "nan_test.pgc"
+
+ }
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
+ #line 42 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 42 "nan_test.pgc"
+
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
+ #line 44 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 44 "nan_test.pgc"
+
+ while (1)
+ {
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 47 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 47 "nan_test.pgc"
+
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+ }
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
+ #line 55 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 55 "nan_test.pgc"
+
+
+ num = PGTYPESnumeric_new();
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest2 ( id int4 , d numeric )", ECPGt_EOIT, ECPGt_EORT);
+ #line 59 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 59 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )", ECPGt_EOIT, ECPGt_EORT);
+ #line 60 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 60 "nan_test.pgc"
+
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select id , d , d from nantest2 where id = 4", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 62 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 62 "nan_test.pgc"
+
+
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 5 , $1 )",
+ ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 66 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 66 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 6 , $1 )",
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
+ #line 67 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 67 "nan_test.pgc"
+
+
+ /* declare cur1 cursor for select id , d , d from nantest2 */
+ #line 69 "nan_test.pgc"
+
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
+ #line 70 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 70 "nan_test.pgc"
+
+ while (1)
+ {
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cur1", ECPGt_EOIT,
+ ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
+ #line 73 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 73 "nan_test.pgc"
+
+ if (sqlca.sqlcode)
+ break;
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+ }
+ { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
+ #line 78 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 78 "nan_test.pgc"
+
+
+ { ECPGtrans(__LINE__, NULL, "rollback");
+ #line 80 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 80 "nan_test.pgc"
+
+ { ECPGdisconnect(__LINE__, "CURRENT");
+ #line 81 "nan_test.pgc"
+
+ if (sqlca.sqlcode < 0) sqlprint ( );}
+ #line 81 "nan_test.pgc"
+
+
+ return (0);
+ }
diff -dcrpN pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr
*** pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 2010-02-02 15:31:04.000000000 +0100
***************
*** 0 ****
--- 1,360 ----
+ [NO_PID]: ECPGdebug: set to 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 24: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 24: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 24: OK: CREATE TABLE
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 25: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'inf' :: float8 ) , ( 3 , '-inf' :: float8 ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 25: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 25: OK: INSERT 0 3
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 28: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 28: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 28: OK: DECLARE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: 1 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 1 = 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 2 = NaN
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 1 = 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 2 = NaN
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: 2 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 1 = 2
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 2 = Infinity
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 1 = 2
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 2 = Infinity
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: 3 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 31: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 1 = 3
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 39: parameter 2 = -Infinity
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 39: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 1 = 3
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 40: parameter 2 = -Infinity
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 31: correctly got 0 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: raising sqlcode 100 on line 31: no data found on line 31
+ [NO_PID]: sqlca: code: 100, state: 02000
+ [NO_PID]: ecpg_execute on line 42: query: close cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 42: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 42: OK: CLOSE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 44: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 44: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 44: OK: DECLARE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 1 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 2 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 3 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 4 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 7 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 5 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 8 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 6 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: 9 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 47: RESULT: -Infinity offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: query: fetch from cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 47: correctly got 0 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: raising sqlcode 100 on line 47: no data found on line 47
+ [NO_PID]: sqlca: code: 100, state: 02000
+ [NO_PID]: ecpg_execute on line 55: query: close cur; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 55: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 55: OK: CLOSE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 59: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 59: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 59: OK: CREATE TABLE
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 60: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 60: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 60: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 62: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 62: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 62: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 62: RESULT: 4 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 62: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 62: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 66: query: insert into nantest2 ( id , d ) values ( 5 , $1 ); with 1 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 66: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 66: parameter 1 = NaN
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 66: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 67: query: insert into nantest2 ( id , d ) values ( 6 , $1 ); with 1 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 67: using PQexecParams
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: free_params on line 67: parameter 1 = NaN
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 67: OK: INSERT 0 1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 70: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 70: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 70: OK: DECLARE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: 4 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: 5 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 1 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: 6 offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_get_data on line 73: RESULT: NaN offset: -1; array: yes
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: query: fetch from cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 73: correctly got 0 tuples with 3 fields
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: raising sqlcode 100 on line 73: no data found on line 73
+ [NO_PID]: sqlca: code: 100, state: 02000
+ [NO_PID]: ecpg_execute on line 78: query: close cur1; with 0 parameter(s) on connection regress1
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 78: using PQexec
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_execute on line 78: OK: CLOSE CURSOR
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ECPGtrans on line 80: action "rollback"; connection "regress1"
+ [NO_PID]: sqlca: code: 0, state: 00000
+ [NO_PID]: ecpg_finish: connection regress1 closed
+ [NO_PID]: sqlca: code: 0, state: 00000
diff -dcrpN pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout
*** pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stdout 2010-02-02 15:22:01.000000000 +0100
***************
*** 0 ****
--- 1,16 ----
+ 1 NaN 'NaN'
+ 2 +Inf 'Infinity'
+ 3 -Inf '-Infinity'
+ 1 NaN 'NaN'
+ 2 +Inf 'Infinity'
+ 3 -Inf '-Infinity'
+ 4 NaN 'NaN'
+ 7 NaN 'NaN'
+ 5 +Inf 'Infinity'
+ 8 +Inf 'Infinity'
+ 6 -Inf '-Infinity'
+ 9 -Inf '-Infinity'
+ 4 NaN 'NaN'
+ 4 NaN 'NaN'
+ 5 NaN 'NaN'
+ 6 NaN 'NaN'
diff -dcrpN pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.c pgsql.1/src/interfaces/ecpg/test/expected/preproc-outofscope.c
*** pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.c 2010-01-29 17:35:57.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/preproc-outofscope.c 2010-02-02 15:22:01.000000000 +0100
***************
*** 31,36 ****
--- 31,37 ----
#define NUMERIC_POS 0x0000
#define NUMERIC_NEG 0x4000
#define NUMERIC_NAN 0xC000
+ #define NUMERIC_NULL 0xF000
#define NUMERIC_MAX_PRECISION 1000
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
#define NUMERIC_MIN_DISPLAY_SCALE 0
diff -dcrpN pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c pgsql.1/src/interfaces/ecpg/test/expected/sql-sqlda.c
*** pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c 2010-01-06 19:06:44.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/expected/sql-sqlda.c 2010-02-02 15:22:01.000000000 +0100
*************** typedef struct sqlda_struct sqlda_t;
*** 53,58 ****
--- 53,59 ----
#define NUMERIC_POS 0x0000
#define NUMERIC_NEG 0x4000
#define NUMERIC_NAN 0xC000
+ #define NUMERIC_NULL 0xF000
#define NUMERIC_MAX_PRECISION 1000
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
#define NUMERIC_MIN_DISPLAY_SCALE 0
diff -dcrpN pgsql/src/interfaces/ecpg/test/pgtypeslib/Makefile pgsql.1/src/interfaces/ecpg/test/pgtypeslib/Makefile
*** pgsql/src/interfaces/ecpg/test/pgtypeslib/Makefile 2006-08-13 12:18:31.000000000 +0200
--- pgsql.1/src/interfaces/ecpg/test/pgtypeslib/Makefile 2010-02-02 15:22:01.000000000 +0100
*************** include $(top_srcdir)/$(subdir)/../Makef
*** 6,12 ****
TESTS = dt_test dt_test.c \
dt_test2 dt_test2.c \
num_test num_test.c \
! num_test2 num_test2.c
all: $(TESTS)
--- 6,13 ----
TESTS = dt_test dt_test.c \
dt_test2 dt_test2.c \
num_test num_test.c \
! num_test2 num_test2.c \
! nan_test nan_test.c
all: $(TESTS)
diff -dcrpN pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql.1/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
*** pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 1970-01-01 01:00:00.000000000 +0100
--- pgsql.1/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-02 15:22:01.000000000 +0100
***************
*** 0 ****
--- 1,84 ----
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+ #include <pgtypes_numeric.h>
+ #include <decimal.h>
+
+ exec sql include ../regression;
+
+ int
+ main(void)
+ {
+ exec sql begin declare section;
+ int id;
+ double d;
+ numeric *num;
+ char val[16];
+ exec sql end declare section;
+
+ ECPGdebug(1, stderr);
+ exec sql whenever sqlerror do sqlprint();
+
+ exec sql connect to REGRESSDB1;
+
+ exec sql create table nantest1 (id int4, d float8);
+ exec sql insert into nantest1 (id, d) values (1, 'nan'::float8), (2, 'inf'::float8), (3, '-inf'::float8);
+
+ exec sql declare cur cursor for select id, d, d from nantest1;
+ exec sql open cur;
+ while (1)
+ {
+ exec sql fetch from cur into :id, :d, :val;
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+
+ exec sql insert into nantest1 (id, d) values (:id + 3, :d);
+ exec sql insert into nantest1 (id, d) values (:id + 6, :val);
+ }
+ exec sql close cur;
+
+ exec sql open cur;
+ while (1)
+ {
+ exec sql fetch from cur into :id, :d, :val;
+ if (sqlca.sqlcode)
+ break;
+ if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
+ if (isnan(d))
+ printf("%d NaN '%s'\n", id, val);
+ }
+ exec sql close cur;
+
+ num = PGTYPESnumeric_new();
+
+ exec sql create table nantest2 (id int4, d numeric);
+ exec sql insert into nantest2 (id, d) values (4, 'nan'::numeric);
+
+ exec sql select id, d, d into :id, :num, :val from nantest2 where id = 4;
+
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+
+ exec sql insert into nantest2 (id, d) values (5, :num);
+ exec sql insert into nantest2 (id, d) values (6, :val);
+
+ exec sql declare cur1 cursor for select id, d, d from nantest2;
+ exec sql open cur1;
+ while (1)
+ {
+ exec sql fetch from cur1 into :id, :num, :val;
+ if (sqlca.sqlcode)
+ break;
+ printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
+ }
+ exec sql close cur1;
+
+ exec sql rollback;
+ exec sql disconnect;
+
+ return (0);
+ }
On Tue, Feb 02, 2010 at 03:34:24PM +0100, Boszormenyi Zoltan wrote:
Here's the new patch with the updated regression test.
Committed. Thanks a lot.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
Michael Meskes írta:
On Tue, Feb 02, 2010 at 03:34:24PM +0100, Boszormenyi Zoltan wrote:
Here's the new patch with the updated regression test.
Committed. Thanks a lot.
Michael
Tom Lane committed a fix for Windows, there was a missing
#include <float.h>
in execute.c, but there is another problem on Windows, which
I can't fix since I don't have a Windows build system.
The linker also complains about missing _isnan(). Can someone help?
The equivalent of "-lm" is needed for the cl linker command.
Also, another oversight needs fixing on my part, for which
the patch is atttached. The INSERT statement in nan_test.pgc
contains platform dependent strings, "inf" instead of "infinity".
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Attachments:
pg85-ecpg-fix-nan-inf-8-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-8-ctxdiff.patchDownload
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-02 17:09:12.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-03 10:43:24.000000000 +0100
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 66,72 ****
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 24 "nan_test.pgc"
! { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'inf' :: float8 ) , ( 3 , '-inf' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
#line 25 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
--- 66,72 ----
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 24 "nan_test.pgc"
! { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
#line 25 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 2010-02-02 17:09:12.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 2010-02-03 10:43:24.000000000 +0100
***************
*** 8,14 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'inf' :: float8 ) , ( 3 , '-inf' :: float8 ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 25: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
--- 8,14 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 24: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 25: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
*** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-02 17:09:12.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-03 10:43:24.000000000 +0100
*************** main(void)
*** 22,28 ****
exec sql connect to REGRESSDB1;
exec sql create table nantest1 (id int4, d float8);
! exec sql insert into nantest1 (id, d) values (1, 'nan'::float8), (2, 'inf'::float8), (3, '-inf'::float8);
exec sql declare cur cursor for select id, d, d from nantest1;
exec sql open cur;
--- 22,28 ----
exec sql connect to REGRESSDB1;
exec sql create table nantest1 (id int4, d float8);
! exec sql insert into nantest1 (id, d) values (1, 'nan'::float8), (2, 'infinity'::float8), (3, '-infinity'::float8);
exec sql declare cur cursor for select id, d, d from nantest1;
exec sql open cur;
On Wed, Feb 03, 2010 at 10:59:57AM +0100, Boszormenyi Zoltan wrote:
Also, another oversight needs fixing on my part, for which
the patch is atttached. The INSERT statement in nan_test.pgc
contains platform dependent strings, "inf" instead of "infinity".
Committed.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
Hi,
I added the #include <float.h> to the nan_test.pgc in the hope
it fixes the Windows machines in the buildfarm.
The patch also contains cleanups in the outofscope and sqlda
regression tests so they do
#include <pgtypes_numeric.h>
instead of
exec sql include pgtypes_numeric.h;
The results of these two regression tests were affected
when I modified this particular header because of this.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Attachments:
pg85-cleanup-regr-tests-2-ctxdiff.patchtext/x-patch; name=pg85-cleanup-regr-tests-2-ctxdiff.patchDownload
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-04 14:49:15.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-04 15:47:10.000000000 +0100
***************
*** 9,14 ****
--- 9,15 ----
#line 1 "nan_test.pgc"
#include <stdio.h>
#include <stdlib.h>
+ #include <float.h>
#include <math.h>
#include <float.h>
#include <pgtypes_numeric.h>
***************
*** 22,28 ****
! #line 8 "nan_test.pgc"
int
--- 23,29 ----
! #line 9 "nan_test.pgc"
int
*************** main(void)
*** 34,87 ****
! #line 14 "nan_test.pgc"
int id ;
! #line 15 "nan_test.pgc"
double d ;
! #line 16 "nan_test.pgc"
numeric * num ;
! #line 17 "nan_test.pgc"
char val [ 16 ] ;
/* exec sql end declare section */
! #line 18 "nan_test.pgc"
ECPGdebug(1, stderr);
/* exec sql whenever sqlerror do sqlprint ( ) ; */
! #line 21 "nan_test.pgc"
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
! #line 23 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 23 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest1 ( id int4 , d float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 25 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 25 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 26 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 26 "nan_test.pgc"
/* declare cur cursor for select id , d , d from nantest1 */
! #line 28 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 29 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 29 "nan_test.pgc"
while (1)
{
--- 35,88 ----
! #line 15 "nan_test.pgc"
int id ;
! #line 16 "nan_test.pgc"
double d ;
! #line 17 "nan_test.pgc"
numeric * num ;
! #line 18 "nan_test.pgc"
char val [ 16 ] ;
/* exec sql end declare section */
! #line 19 "nan_test.pgc"
ECPGdebug(1, stderr);
/* exec sql whenever sqlerror do sqlprint ( ) ; */
! #line 22 "nan_test.pgc"
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
! #line 24 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 24 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest1 ( id int4 , d float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 26 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 26 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )", ECPGt_EOIT, ECPGt_EORT);
! #line 27 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 27 "nan_test.pgc"
/* declare cur cursor for select id , d , d from nantest1 */
! #line 29 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 30 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 30 "nan_test.pgc"
while (1)
{
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 92,101 ****
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 32 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 32 "nan_test.pgc"
if (sqlca.sqlcode)
break;
--- 93,102 ----
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 33 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 33 "nan_test.pgc"
if (sqlca.sqlcode)
break;
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 109,142 ****
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 40 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 40 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )",
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 41 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 41 "nan_test.pgc"
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 43 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 43 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 45 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 45 "nan_test.pgc"
while (1)
{
--- 110,143 ----
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 41 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 41 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )",
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 42 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 42 "nan_test.pgc"
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 44 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 44 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select id , d , d from nantest1", ECPGt_EOIT, ECPGt_EORT);
! #line 46 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 46 "nan_test.pgc"
while (1)
{
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 147,156 ****
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 48 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 48 "nan_test.pgc"
if (sqlca.sqlcode)
break;
--- 148,157 ----
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 49 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 49 "nan_test.pgc"
if (sqlca.sqlcode)
break;
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 160,184 ****
printf("%d NaN '%s'\n", id, val);
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 56 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 56 "nan_test.pgc"
num = PGTYPESnumeric_new();
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest2 ( id int4 , d numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 60 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 60 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 61 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 61 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select id , d , d from nantest2 where id = 4", ECPGt_EOIT,
--- 161,185 ----
printf("%d NaN '%s'\n", id, val);
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT);
! #line 57 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 57 "nan_test.pgc"
num = PGTYPESnumeric_new();
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table nantest2 ( id int4 , d numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 61 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 61 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )", ECPGt_EOIT, ECPGt_EORT);
! #line 62 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 62 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select id , d , d from nantest2 where id = 4", ECPGt_EOIT,
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 188,197 ****
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 63 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 63 "nan_test.pgc"
printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
--- 189,198 ----
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 64 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 64 "nan_test.pgc"
printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 199,226 ****
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 5 , $1 )",
ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 67 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 67 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 6 , $1 )",
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 68 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 68 "nan_test.pgc"
/* declare cur1 cursor for select id , d , d from nantest2 */
! #line 70 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
! #line 71 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 71 "nan_test.pgc"
while (1)
{
--- 200,227 ----
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 5 , $1 )",
ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 68 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 68 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest2 ( id , d ) values ( 6 , $1 )",
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
! #line 69 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 69 "nan_test.pgc"
/* declare cur1 cursor for select id , d , d from nantest2 */
! #line 71 "nan_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur1 cursor for select id , d , d from nantest2", ECPGt_EOIT, ECPGt_EORT);
! #line 72 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 72 "nan_test.pgc"
while (1)
{
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 231,263 ****
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 74 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 74 "nan_test.pgc"
if (sqlca.sqlcode)
break;
printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
! #line 79 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 79 "nan_test.pgc"
{ ECPGtrans(__LINE__, NULL, "rollback");
! #line 81 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 81 "nan_test.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 82 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 82 "nan_test.pgc"
return (0);
--- 232,264 ----
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
! #line 75 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 75 "nan_test.pgc"
if (sqlca.sqlcode)
break;
printf("%d %s '%s'\n", id, (num->sign == NUMERIC_NAN ? "NaN" : "not NaN"), val);
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur1", ECPGt_EOIT, ECPGt_EORT);
! #line 80 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 80 "nan_test.pgc"
{ ECPGtrans(__LINE__, NULL, "rollback");
! #line 82 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 82 "nan_test.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 83 "nan_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
! #line 83 "nan_test.pgc"
return (0);
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 2010-02-04 14:49:15.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.stderr 2010-02-04 15:47:09.000000000 +0100
***************
*** 2,48 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 25: OK: CREATE TABLE
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: OK: INSERT 0 3
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 29: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 29: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 29: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 2 = NaN
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
--- 2,38 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: query: create table nantest1 ( id int4 , d float8 ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 26: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 26: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 27: query: insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 27: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 27: OK: INSERT 0 3
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 30: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 30: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
***************
*** 52,80 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 1 = 2
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 2 = Infinity
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
--- 42,70 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 2 = NaN
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
***************
*** 84,112 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 32: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 1 = 3
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 40: parameter 2 = -Infinity
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
--- 74,102 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 1 = 2
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 2 = Infinity
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 33: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 41: query: insert into nantest1 ( id , d ) values ( $1 + 3 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
***************
*** 116,296 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 32: correctly got 0 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 32: no data found on line 32
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 43: query: close cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 43: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 43: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 45: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 45: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 45: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 7 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 5 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 8 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 6 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 9 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 0 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 48: no data found on line 48
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 56: query: close cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 56: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 56: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 60: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 60: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 60: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 63: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 63: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 63: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 63: RESULT: 4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 63: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 63: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 67: query: insert into nantest2 ( id , d ) values ( 5 , $1 ); with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 67: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 67: parameter 1 = NaN
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 67: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 68: query: insert into nantest2 ( id , d ) values ( 6 , $1 ); with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 68: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
--- 106,288 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: query: insert into nantest1 ( id , d ) values ( $1 + 6 , $2 ); with 2 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 1 = 3
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 42: parameter 2 = -Infinity
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 42: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 33: correctly got 0 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 33: no data found on line 33
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 44: query: close cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 44: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 44: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 46: query: declare cur cursor for select id , d , d from nantest1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 46: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 46: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 7 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 5 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 8 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 6 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 9 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: -Infinity offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch from cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 0 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 49: no data found on line 49
! [NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 57: query: close cur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: query: create table nantest2 ( id int4 , d numeric ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 61: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 62: query: insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 62: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 62: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 64: query: select id , d , d from nantest2 where id = 4; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 64: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 64: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 64: RESULT: 4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 64: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 64: RESULT: NaN offset: -1; array: no
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 68: query: insert into nantest2 ( id , d ) values ( 5 , $1 ); with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 68: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
***************
*** 298,360 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 68: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 71: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 71: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 71: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: 4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: 5 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: 6 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 74: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: query: fetch from cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 74: correctly got 0 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 74: no data found on line 74
[NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 79: query: close cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 79: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 79: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 81: action "rollback"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection regress1 closed
[NO_PID]: sqlca: code: 0, state: 00000
--- 290,360 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 68: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 69: query: insert into nantest2 ( id , d ) values ( 6 , $1 ); with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 69: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: free_params on line 69: parameter 1 = NaN
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 69: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 72: query: declare cur1 cursor for select id , d , d from nantest2; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 72: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 72: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: 4 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: 5 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: 6 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 75: RESULT: NaN offset: -1; array: no
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: query: fetch from cur1; with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 75: correctly got 0 tuples with 3 fields
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 75: no data found on line 75
[NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 80: query: close cur1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 82: action "rollback"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection regress1 closed
[NO_PID]: sqlca: code: 0, state: 00000
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.c pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.c 2010-02-02 17:34:42.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.c 2010-02-04 15:38:20.000000000 +0100
***************
*** 11,16 ****
--- 11,17 ----
#include <stdlib.h>
#include <string.h>
#include <limits.h>
+ #include <pgtypes_numeric.h>
#line 1 "regression.h"
***************
*** 20,99 ****
! #line 6 "outofscope.pgc"
!
!
!
! #line 1 "pgtypes_numeric.h"
! #ifndef PGTYPES_NUMERIC
! #define PGTYPES_NUMERIC
!
! #define NUMERIC_POS 0x0000
! #define NUMERIC_NEG 0x4000
! #define NUMERIC_NAN 0xC000
! #define NUMERIC_NULL 0xF000
! #define NUMERIC_MAX_PRECISION 1000
! #define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
! #define NUMERIC_MIN_DISPLAY_SCALE 0
! #define NUMERIC_MIN_SIG_DIGITS 16
!
! #define DECSIZE 30
!
! typedef unsigned char NumericDigit;
! typedef struct
! {
! int ndigits; /* number of digits in digits[] - can be 0! */
! int weight; /* weight of first digit */
! int rscale; /* result scale */
! int dscale; /* display scale */
! int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
! NumericDigit *buf; /* start of alloc'd space for digits[] */
! NumericDigit *digits; /* decimal digits */
! } numeric;
!
! typedef struct
! {
! int ndigits; /* number of digits in digits[] - can be 0! */
! int weight; /* weight of first digit */
! int rscale; /* result scale */
! int dscale; /* display scale */
! int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
! NumericDigit digits[DECSIZE]; /* decimal digits */
! } decimal;
!
! #ifdef __cplusplus
! extern "C"
! {
! #endif
!
! numeric *PGTYPESnumeric_new(void);
! decimal *PGTYPESdecimal_new(void);
! void PGTYPESnumeric_free(numeric *);
! void PGTYPESdecimal_free(decimal *);
! numeric *PGTYPESnumeric_from_asc(char *, char **);
! char *PGTYPESnumeric_to_asc(numeric *, int);
! int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
! int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
! int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
! int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
! int PGTYPESnumeric_cmp(numeric *, numeric *);
! int PGTYPESnumeric_from_int(signed int, numeric *);
! int PGTYPESnumeric_from_long(signed long int, numeric *);
! int PGTYPESnumeric_copy(numeric *, numeric *);
! int PGTYPESnumeric_from_double(double, numeric *);
! int PGTYPESnumeric_to_double(numeric *, double *);
! int PGTYPESnumeric_to_int(numeric *, int *);
! int PGTYPESnumeric_to_long(numeric *, long *);
! int PGTYPESnumeric_to_decimal(numeric *, decimal *);
! int PGTYPESnumeric_from_decimal(decimal *, numeric *);
!
! #ifdef __cplusplus
! }
! #endif
!
! #endif /* PGTYPES_NUMERIC */
!
! #line 8 "outofscope.pgc"
/* exec sql begin declare section */
--- 21,27 ----
! #line 7 "outofscope.pgc"
/* exec sql begin declare section */
*************** int PGTYPESnumeric_from_decimal(decima
*** 124,130 ****
#line 18 "struct.h"
! #line 11 "outofscope.pgc"
struct mytype {
#line 3 "struct.h"
--- 52,58 ----
#line 18 "struct.h"
! #line 10 "outofscope.pgc"
struct mytype {
#line 3 "struct.h"
*************** struct mytype {
*** 157,167 ****
#line 16 "struct.h"
int c ;
} ;/* exec sql end declare section */
! #line 12 "outofscope.pgc"
/* exec sql whenever sqlerror stop ; */
! #line 14 "outofscope.pgc"
/* Functions for test 1 */
--- 85,95 ----
#line 16 "struct.h"
int c ;
} ;/* exec sql end declare section */
! #line 11 "outofscope.pgc"
/* exec sql whenever sqlerror stop ; */
! #line 13 "outofscope.pgc"
/* Functions for test 1 */
*************** get_var1(MYTYPE **myvar0, MYNULLTYPE **m
*** 173,185 ****
! #line 22 "outofscope.pgc"
MYTYPE * myvar = malloc ( sizeof ( MYTYPE ) ) ;
! #line 23 "outofscope.pgc"
MYNULLTYPE * mynullvar = malloc ( sizeof ( MYNULLTYPE ) ) ;
/* exec sql end declare section */
! #line 24 "outofscope.pgc"
/* Test DECLARE ... SELECT ... INTO with pointers */
--- 101,113 ----
! #line 21 "outofscope.pgc"
MYTYPE * myvar = malloc ( sizeof ( MYTYPE ) ) ;
! #line 22 "outofscope.pgc"
MYNULLTYPE * mynullvar = malloc ( sizeof ( MYNULLTYPE ) ) ;
/* exec sql end declare section */
! #line 23 "outofscope.pgc"
/* Test DECLARE ... SELECT ... INTO with pointers */
*************** get_var1(MYTYPE **myvar0, MYNULLTYPE **m
*** 187,193 ****
ECPGset_var( 0, ( myvar ), __LINE__);\
ECPGset_var( 1, ( mynullvar ), __LINE__);\
/* declare mycur cursor for select * from a1 */
! #line 28 "outofscope.pgc"
if (sqlca.sqlcode != 0)
--- 115,121 ----
ECPGset_var( 0, ( myvar ), __LINE__);\
ECPGset_var( 1, ( mynullvar ), __LINE__);\
/* declare mycur cursor for select * from a1 */
! #line 27 "outofscope.pgc"
if (sqlca.sqlcode != 0)
*************** open_cur1(void)
*** 211,220 ****
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int),
ECPGt_char,&((*( MYTYPE *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char),
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 40 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 40 "outofscope.pgc"
if (sqlca.sqlcode != 0)
--- 139,148 ----
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int),
ECPGt_char,&((*( MYTYPE *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char),
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 39 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 39 "outofscope.pgc"
if (sqlca.sqlcode != 0)
*************** get_record1(void)
*** 235,244 ****
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int),
ECPGt_char,&((*( MYTYPE *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char),
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 49 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 49 "outofscope.pgc"
if (sqlca.sqlcode != 0 && sqlca.sqlcode != ECPG_NOT_FOUND)
--- 163,172 ----
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).d2),(long)1,(long)1,sizeof(int),
ECPGt_char,&((*( MYTYPE *)(ECPGget_var( 0))).c),(long)30,(long)1,(30)*sizeof(char),
ECPGt_int,&((*( MYNULLTYPE *)(ECPGget_var( 1))).c),(long)1,(long)1,sizeof(int), ECPGt_EORT);
! #line 48 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 48 "outofscope.pgc"
if (sqlca.sqlcode != 0 && sqlca.sqlcode != ECPG_NOT_FOUND)
*************** static void
*** 249,258 ****
close_cur1(void)
{
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur", ECPGt_EOIT, ECPGt_EORT);
! #line 58 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 58 "outofscope.pgc"
if (sqlca.sqlcode != 0)
--- 177,186 ----
close_cur1(void)
{
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur", ECPGt_EOIT, ECPGt_EORT);
! #line 57 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 57 "outofscope.pgc"
if (sqlca.sqlcode != 0)
*************** main (void)
*** 271,324 ****
strcpy(msg, "connect");
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
! #line 75 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 75 "outofscope.pgc"
strcpy(msg, "set");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
! #line 78 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 78 "outofscope.pgc"
strcpy(msg, "create");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) )", ECPGt_EOIT, ECPGt_EORT);
! #line 81 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 81 "outofscope.pgc"
strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' )", ECPGt_EOIT, ECPGt_EORT);
! #line 84 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 84 "outofscope.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null )", ECPGt_EOIT, ECPGt_EORT);
! #line 85 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 85 "outofscope.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' )", ECPGt_EOIT, ECPGt_EORT);
! #line 86 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 86 "outofscope.pgc"
strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit");
! #line 89 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 89 "outofscope.pgc"
/* Test out-of-scope DECLARE/OPEN/FETCH/CLOSE */
--- 199,252 ----
strcpy(msg, "connect");
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
! #line 74 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 74 "outofscope.pgc"
strcpy(msg, "set");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
! #line 77 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 77 "outofscope.pgc"
strcpy(msg, "create");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) )", ECPGt_EOIT, ECPGt_EORT);
! #line 80 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 80 "outofscope.pgc"
strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' )", ECPGt_EOIT, ECPGt_EORT);
! #line 83 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 83 "outofscope.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null )", ECPGt_EOIT, ECPGt_EORT);
! #line 84 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 84 "outofscope.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' )", ECPGt_EOIT, ECPGt_EORT);
! #line 85 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 85 "outofscope.pgc"
strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit");
! #line 88 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 88 "outofscope.pgc"
/* Test out-of-scope DECLARE/OPEN/FETCH/CLOSE */
*************** if (sqlca.sqlcode < 0) exit (1);}
*** 327,333 ****
open_cur1();
/* exec sql whenever not found break ; */
! #line 96 "outofscope.pgc"
while (1)
--- 255,261 ----
open_cur1();
/* exec sql whenever not found break ; */
! #line 95 "outofscope.pgc"
while (1)
*************** if (sqlca.sqlcode < 0) exit (1);}
*** 348,373 ****
strcpy(msg, "drop");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table a1", ECPGt_EOIT, ECPGt_EORT);
! #line 115 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 115 "outofscope.pgc"
strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit");
! #line 118 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 118 "outofscope.pgc"
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 121 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 121 "outofscope.pgc"
return (0);
--- 276,301 ----
strcpy(msg, "drop");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table a1", ECPGt_EOIT, ECPGt_EORT);
! #line 114 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 114 "outofscope.pgc"
strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit");
! #line 117 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 117 "outofscope.pgc"
strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT");
! #line 120 "outofscope.pgc"
if (sqlca.sqlcode < 0) exit (1);}
! #line 120 "outofscope.pgc"
return (0);
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr
*** pgsql.orig/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr 2010-02-04 11:10:03.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/preproc-outofscope.stderr 2010-02-04 15:47:10.000000000 +0100
***************
*** 2,114 ****
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 78: query: set datestyle to iso; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 78: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 78: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 81: query: create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 81: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 81: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 84: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 84: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 84: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 85: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 86: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' ); with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 86: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 86: OK: INSERT 0 1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 89: action "commit"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: query: declare mycur cursor for select * from a1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 40: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: a offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 1.0 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: a offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 2.0 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 49: RESULT: b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 49: correctly got 0 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 49: no data found on line 49
[NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 58: query: close mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 58: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 58: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 115: query: drop table a1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 115: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 115: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 118: action "commit"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection regress1 closed
[NO_PID]: sqlca: code: 0, state: 00000
--- 2,114 ----
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 77: query: set datestyle to iso; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 77: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 77: OK: SET
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: query: create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 80: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 83: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' ); with 0 parameter(s) on connection regress1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 83: using PQexec
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 83: OK: INSERT 0 1
! [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 84: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 84: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 84: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 85: query: insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_execute on line 85: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 88: action "commit"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 39: query: declare mycur cursor for select * from a1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 39: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 1 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: a offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 1.0 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: a offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 1 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 2.0 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: 3 offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_get_data on line 48: RESULT: b offset: -1; array: no
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: query: fetch mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 48: correctly got 0 tuples with 5 fields
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: raising sqlcode 100 on line 48: no data found on line 48
[NO_PID]: sqlca: code: 100, state: 02000
! [NO_PID]: ecpg_execute on line 57: query: close mycur; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 57: OK: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 114: query: drop table a1; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 114: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ecpg_execute on line 114: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGtrans on line 117: action "commit"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: connection regress1 closed
[NO_PID]: sqlca: code: 0, state: 00000
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/sql-sqlda.c pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/sql-sqlda.c 2010-02-02 17:34:42.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c 2010-02-04 15:38:20.000000000 +0100
***************
*** 10,15 ****
--- 10,16 ----
#include <stdlib.h>
#include <string.h>
#include <limits.h>
+ #include <pgtypes_numeric.h>
#line 1 "regression.h"
***************
*** 19,25 ****
! #line 5 "sqlda.pgc"
--- 20,26 ----
! #line 6 "sqlda.pgc"
*************** typedef struct sqlda_struct sqlda_t;
*** 43,120 ****
#endif /* ECPG_SQLDA_H */
- #line 7 "sqlda.pgc"
-
-
- #line 1 "pgtypes_numeric.h"
- #ifndef PGTYPES_NUMERIC
- #define PGTYPES_NUMERIC
-
- #define NUMERIC_POS 0x0000
- #define NUMERIC_NEG 0x4000
- #define NUMERIC_NAN 0xC000
- #define NUMERIC_NULL 0xF000
- #define NUMERIC_MAX_PRECISION 1000
- #define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
- #define NUMERIC_MIN_DISPLAY_SCALE 0
- #define NUMERIC_MIN_SIG_DIGITS 16
-
- #define DECSIZE 30
-
- typedef unsigned char NumericDigit;
- typedef struct
- {
- int ndigits; /* number of digits in digits[] - can be 0! */
- int weight; /* weight of first digit */
- int rscale; /* result scale */
- int dscale; /* display scale */
- int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- NumericDigit *buf; /* start of alloc'd space for digits[] */
- NumericDigit *digits; /* decimal digits */
- } numeric;
-
- typedef struct
- {
- int ndigits; /* number of digits in digits[] - can be 0! */
- int weight; /* weight of first digit */
- int rscale; /* result scale */
- int dscale; /* display scale */
- int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- NumericDigit digits[DECSIZE]; /* decimal digits */
- } decimal;
-
- #ifdef __cplusplus
- extern "C"
- {
- #endif
-
- numeric *PGTYPESnumeric_new(void);
- decimal *PGTYPESdecimal_new(void);
- void PGTYPESnumeric_free(numeric *);
- void PGTYPESdecimal_free(decimal *);
- numeric *PGTYPESnumeric_from_asc(char *, char **);
- char *PGTYPESnumeric_to_asc(numeric *, int);
- int PGTYPESnumeric_add(numeric *, numeric *, numeric *);
- int PGTYPESnumeric_sub(numeric *, numeric *, numeric *);
- int PGTYPESnumeric_mul(numeric *, numeric *, numeric *);
- int PGTYPESnumeric_div(numeric *, numeric *, numeric *);
- int PGTYPESnumeric_cmp(numeric *, numeric *);
- int PGTYPESnumeric_from_int(signed int, numeric *);
- int PGTYPESnumeric_from_long(signed long int, numeric *);
- int PGTYPESnumeric_copy(numeric *, numeric *);
- int PGTYPESnumeric_from_double(double, numeric *);
- int PGTYPESnumeric_to_double(numeric *, double *);
- int PGTYPESnumeric_to_int(numeric *, int *);
- int PGTYPESnumeric_to_long(numeric *, long *);
- int PGTYPESnumeric_to_decimal(numeric *, decimal *);
- int PGTYPESnumeric_from_decimal(decimal *, numeric *);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* PGTYPES_NUMERIC */
-
#line 8 "sqlda.pgc"
--- 44,49 ----
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
*** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-04 14:49:15.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-04 15:38:20.000000000 +0100
***************
*** 1,5 ****
--- 1,6 ----
#include <stdio.h>
#include <stdlib.h>
+ #include <float.h>
#include <math.h>
#include <float.h>
#include <pgtypes_numeric.h>
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/preproc/outofscope.pgc pgsql/src/interfaces/ecpg/test/preproc/outofscope.pgc
*** pgsql.orig/src/interfaces/ecpg/test/preproc/outofscope.pgc 2010-01-29 17:35:57.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/preproc/outofscope.pgc 2010-02-04 15:38:20.000000000 +0100
***************
*** 2,12 ****
#include <stdlib.h>
#include <string.h>
#include <limits.h>
exec sql include ../regression;
- exec sql include pgtypes_numeric.h;
-
exec sql begin declare section;
exec sql include struct.h;
exec sql end declare section;
--- 2,11 ----
#include <stdlib.h>
#include <string.h>
#include <limits.h>
+ #include <pgtypes_numeric.h>
exec sql include ../regression;
exec sql begin declare section;
exec sql include struct.h;
exec sql end declare section;
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/sql/sqlda.pgc pgsql/src/interfaces/ecpg/test/sql/sqlda.pgc
*** pgsql.orig/src/interfaces/ecpg/test/sql/sqlda.pgc 2010-01-06 19:06:46.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/sql/sqlda.pgc 2010-02-04 15:38:20.000000000 +0100
***************
*** 1,11 ****
#include <stdlib.h>
#include <string.h>
#include <limits.h>
exec sql include ../regression;
exec sql include sqlda.h;
- exec sql include pgtypes_numeric.h;
exec sql whenever sqlerror stop;
--- 1,11 ----
#include <stdlib.h>
#include <string.h>
#include <limits.h>
+ #include <pgtypes_numeric.h>
exec sql include ../regression;
exec sql include sqlda.h;
exec sql whenever sqlerror stop;
On Thu, Feb 04, 2010 at 03:55:06PM +0100, Boszormenyi Zoltan wrote:
I added the #include <float.h> to the nan_test.pgc in the hope
it fixes the Windows machines in the buildfarm.
I already commited this earlier today after looking at the problem myself. But
of course I'm also just hoping as I do not have a Windows build system either.
So could you please re-diff?
The patch also contains cleanups in the outofscope and sqlda
regression tests so they do
#include <pgtypes_numeric.h>
instead of
exec sql include pgtypes_numeric.h;
Is there a reason for this?
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
Hi,
buildfarm member "pika" fails the NaN test.
Does FreeBSD/MIPS really return true for isinf(NaN)?
Anyway, the attached patch tries to fix the test case
by testing isnan() first and doesn't check isinf()
if isnan() returned true.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Attachments:
pg85-ecpg-fix-nan-inf-10-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-10-ctxdiff.patchDownload
diff -durpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
--- pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-09 11:43:57.000000000 +0100
+++ pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-16 12:10:55.000000000 +0100
@@ -104,10 +104,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
if (sqlca.sqlcode)
break;
- if (isinf(d))
- printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
+ else if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 3 , $2 )",
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
diff -durpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
--- pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-09 11:43:57.000000000 +0100
+++ pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-16 12:04:59.000000000 +0100
@@ -37,10 +37,10 @@ main(void)
exec sql fetch from cur into :id, :d, :val;
if (sqlca.sqlcode)
break;
- if (isinf(d))
- printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
+ else if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
exec sql insert into nantest1 (id, d) values (:id + 3, :d);
exec sql insert into nantest1 (id, d) values (:id + 6, :val);
Boszormenyi Zoltan írta:
Hi,
buildfarm member "pika" fails the NaN test.
Does FreeBSD/MIPS really return true for isinf(NaN)?
Anyway, the attached patch tries to fix the test case
by testing isnan() first and doesn't check isinf()
if isnan() returned true.
I lied in the patch name, it wasn't a context diff.
Also, the same remedy seems to be needed in ecpglib/execute.c, too.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Attachments:
pg85-ecpg-fix-nan-inf-11-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-11-ctxdiff.patchDownload
diff -dcrpN pgsql.orig/src/interfaces/ecpg/ecpglib/execute.c pgsql/src/interfaces/ecpg/ecpglib/execute.c
*** pgsql.orig/src/interfaces/ecpg/ecpglib/execute.c 2010-02-04 11:10:03.000000000 +0100
--- pgsql/src/interfaces/ecpg/ecpglib/execute.c 2010-02-16 12:19:38.000000000 +0100
*************** ecpg_store_result(const PGresult *result
*** 468,482 ****
static void
sprintf_double_value(char *ptr, double value, const char *delim)
{
! if (isinf(value))
{
if (value < 0)
sprintf(ptr, "%s%s", "-Infinity", delim);
else
sprintf(ptr, "%s%s", "Infinity", delim);
}
- else if (isnan(value))
- sprintf(ptr, "%s%s", "NaN", delim);
else
sprintf(ptr, "%.14g%s", value, delim);
}
--- 468,482 ----
static void
sprintf_double_value(char *ptr, double value, const char *delim)
{
! if (isnan(value))
! sprintf(ptr, "%s%s", "NaN", delim);
! else if (isinf(value))
{
if (value < 0)
sprintf(ptr, "%s%s", "-Infinity", delim);
else
sprintf(ptr, "%s%s", "Infinity", delim);
}
else
sprintf(ptr, "%.14g%s", value, delim);
}
*************** sprintf_double_value(char *ptr, double v
*** 484,498 ****
static void
sprintf_float_value(char *ptr, float value, const char *delim)
{
! if (isinf(value))
{
if (value < 0)
sprintf(ptr, "%s%s", "-Infinity", delim);
else
sprintf(ptr, "%s%s", "Infinity", delim);
}
- else if (isnan(value))
- sprintf(ptr, "%s%s", "NaN", delim);
else
sprintf(ptr, "%.14g%s", value, delim);
}
--- 484,498 ----
static void
sprintf_float_value(char *ptr, float value, const char *delim)
{
! if (isnan(value))
! sprintf(ptr, "%s%s", "NaN", delim);
! else if (isinf(value))
{
if (value < 0)
sprintf(ptr, "%s%s", "-Infinity", delim);
else
sprintf(ptr, "%s%s", "Infinity", delim);
}
else
sprintf(ptr, "%.14g%s", value, delim);
}
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-09 11:43:57.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-16 12:10:55.000000000 +0100
*************** if (sqlca.sqlcode < 0) sqlprint ( );}
*** 104,113 ****
if (sqlca.sqlcode)
break;
- if (isinf(d))
- printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 3 , $2 )",
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
--- 104,113 ----
if (sqlca.sqlcode)
break;
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
+ else if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into nantest1 ( id , d ) values ( $1 + 3 , $2 )",
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
*** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-09 11:43:57.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-16 12:04:59.000000000 +0100
*************** main(void)
*** 37,46 ****
exec sql fetch from cur into :id, :d, :val;
if (sqlca.sqlcode)
break;
- if (isinf(d))
- printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
exec sql insert into nantest1 (id, d) values (:id + 3, :d);
exec sql insert into nantest1 (id, d) values (:id + 6, :val);
--- 37,46 ----
exec sql fetch from cur into :id, :d, :val;
if (sqlca.sqlcode)
break;
if (isnan(d))
printf("%d NaN '%s'\n", id, val);
+ else if (isinf(d))
+ printf("%d %sInf '%s'\n", id, (d < 0 ? "-" : "+"), val);
exec sql insert into nantest1 (id, d) values (:id + 3, :d);
exec sql insert into nantest1 (id, d) values (:id + 6, :val);
On Tue, Feb 16, 2010 at 12:21:34PM +0100, Boszormenyi Zoltan wrote:
Does FreeBSD/MIPS really return true for isinf(NaN)?
Actually it's a netbsd beta version, so maybe there's a bug in their libc.
But anyway, the patch doesn't seem to hurt, so I committed it.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
Michael Meskes írta:
On Tue, Feb 16, 2010 at 12:21:34PM +0100, Boszormenyi Zoltan wrote:
Does FreeBSD/MIPS really return true for isinf(NaN)?
Actually it's a netbsd beta version, so maybe there's a bug in their libc.
I realized my typo after sending my mail. Sorry if I offended anyone
calling NetBSD FreeBSD. :-)
But anyway, the patch doesn't seem to hurt, so I committed it.
Thanks.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
I realized my typo after sending my mail. Sorry if I offended anyone
calling NetBSD FreeBSD. :-)
I was trying to stress the *beta* status. Maybe someone into NetBSD might be
interested in reporting this as a bug. At least it behaves different to all
other archs we have.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
On Tue, Feb 16, 2010 at 10:28:00PM +0100, Michael Meskes wrote:
I was trying to stress the *beta* status. Maybe someone into NetBSD might be
interested in reporting this as a bug. At least it behaves different to all
other archs we have.
Hmm, it seems the patch didn't work. Back to the drawing board.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
Michael Meskes írta:
On Tue, Feb 16, 2010 at 10:28:00PM +0100, Michael Meskes wrote:
I was trying to stress the *beta* status. Maybe someone into NetBSD might be
interested in reporting this as a bug. At least it behaves different to all
other archs we have.Hmm, it seems the patch didn't work. Back to the drawing board.
I hope the amd64 version of NetBSD 5.0.2 behaves similarly,
I can only try it as a VM guest...
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Boszormenyi Zoltan írta:
Michael Meskes írta:
On Tue, Feb 16, 2010 at 10:28:00PM +0100, Michael Meskes wrote:
I was trying to stress the *beta* status. Maybe someone into NetBSD might be
interested in reporting this as a bug. At least it behaves different to all
other archs we have.Hmm, it seems the patch didn't work. Back to the drawing board.
I hope the amd64 version of NetBSD 5.0.2 behaves similarly,
I can only try it as a VM guest...
NetBSD 5.0.2/x86_64 passed all both the main and the ECPG
"make check" tests. The BETA might have had a bug or
NetBSD/MIPS has some quirks I can't solve. Now what?
On a sidenote, this machine fails for the 8.4 STABLE tree, too,
in the main "make check"...
Is this buildfarm member for detecting bugs in the already
obsolete NetBSD 5.0 BETA, or what? The final 5.0 and
two bugfix releases are already out for a while. The owner
of that particular machine should upgrade.
Best regards,
Zoltán Böszörményi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/
Le 17 févr. 2010 à 12:18, Boszormenyi Zoltan a écrit :
Is this buildfarm member for detecting bugs in the already
obsolete NetBSD 5.0 BETA, or what? The final 5.0 and
two bugfix releases are already out for a while. The owner
of that particular machine should upgrade.
I upgraded pika to NetBSD 5.0.2, and the problem is still there.
There are some tests (in "core") which tests for NaN and Infinity, which pass. So either those tests are insufficient, or the code does something different there.
Anything you want me to try ?
Regards,
Rémi Zara
Le 17 févr. 2010 à 12:18, Boszormenyi Zoltan a écrit :
Is this buildfarm member for detecting bugs in the already
obsolete NetBSD 5.0 BETA, or what? The final 5.0 and
two bugfix releases are already out for a while. The owner
of that particular machine should upgrade.
I upgraded pika to NetBSD 5.0.2, and the problem is still there.
There are some tests (in "core") which tests for NaN and Infinity, which pass. So either those tests are insufficient, or the code does something different there.
Anything you want me to try ?
Regards,
Rémi Zara
R�mi Zara �rta:
Le 17 f�vr. 2010 � 12:18, Boszormenyi Zoltan a �crit :
Is this buildfarm member for detecting bugs in the already
obsolete NetBSD 5.0 BETA, or what? The final 5.0 and
two bugfix releases are already out for a while. The owner
of that particular machine should upgrade.I upgraded pika to NetBSD 5.0.2,
Thanks very much for that.
and the problem is still there.
:-(
There are some tests (in "core") which tests for NaN and Infinity, which pass. So either those tests are insufficient, or the code does something different there.
Anything you want me to try ?
Here's the attached test code. Compile it with
gcc -Wall -o nantest nantest.c -lm
and run it. It tests NAN anf INFINITY values with isinf() and isnan().
The expected output is:
==================
$ ./nantest
computed NAN
1 0
computed INFINITY
0 1
==================
Instead of "computed", NetBSD/x86-64 prints "defined"
but the test results are the same as under Linux/x86-64.
Best regards,
Zolt�n B�sz�rm�nyi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zolt�n B�sz�rm�nyi
Cybertec Sch�nig & Sch�nig GmbH
http://www.postgresql.at/
Attachments:
Le 24 févr. 2010 à 18:58, Boszormenyi Zoltan a écrit :
Here's the attached test code. Compile it with
gcc -Wall -o nantest nantest.c -lm
and run it. It tests NAN anf INFINITY values with isinf() and isnan().
The expected output is:==================
$ ./nantest
computed NAN
1 0
computed INFINITY
0 1
==================Instead of "computed", NetBSD/x86-64 prints "defined"
but the test results are the same as under Linux/x86-64.
Here it is :
-bash-4.1$ gcc -Wall -o nantest nantest.c -lm
-bash-4.1$ ./nantest
defined NAN
0 1
defined INFINITY
0 1
Ok. So, on NetBSD/mips (#ifdef __NetBSD__ && __mips__), isnan(NAN) is true, isnan((double)NAN) is false, and isnan((double)(0.0 / 0.0)) is true.
Regards,
Rémi Zara
R�mi Zara �rta:
Le 24 f�vr. 2010 � 18:58, Boszormenyi Zoltan a �crit :
Here's the attached test code. Compile it with
gcc -Wall -o nantest nantest.c -lm
and run it. It tests NAN anf INFINITY values with isinf() and isnan().
The expected output is:==================
$ ./nantest
computed NAN
1 0
computed INFINITY
0 1
==================Instead of "computed", NetBSD/x86-64 prints "defined"
but the test results are the same as under Linux/x86-64.Here it is :
First, thanks for running it.
-bash-4.1$ gcc -Wall -o nantest nantest.c -lm
-bash-4.1$ ./nantest
defined NAN
0 1
So: isnan((double)NAN) == false, isinf((double)NAN) == true?
No wonder this causes a little problem.
defined INFINITY
0 1Ok. So, on NetBSD/mips (#ifdef __NetBSD__ && __mips__), isnan(NAN) is true, isnan((double)NAN) is false, and isnan((double)(0.0 / 0.0)) is true.
Regards,
R�mi Zara
NAN on NetBSD/x86-64 is defined as:
extern const union __float_u __nanf;
#define NAN __nanf.__val
I would guess that it's similar on mips. Is is possible that
NetBSD/mips has a conversion bug?
What I don't get is that the code I used in ECPG and in this
test code is the same as in src/backend/utils/adt/float.c. E.g.:
float8in sees "NaN" -> value will be (double)NAN
float8out sees isnan(value) -> outputs "NaN" string
Can someone shed some light on why the backend
doesn't get the problem as above? :-(
As R�mi says, isnan((double)(0.0 / 0.0)) == true for him.
Michael: IIRC, IEEE754 explicit about that the (0.0/0.0) division
produces NaN. How about doing it explicitely in ECPG?
R�mi: please, run this code to confirm the above?
Best regards,
Zolt�n B�sz�rm�nyi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zolt�n B�sz�rm�nyi
Cybertec Sch�nig & Sch�nig GmbH
http://www.postgresql.at/
Attachments:
Le 25 févr. 2010 à 11:26, Boszormenyi Zoltan a écrit :
NAN on NetBSD/x86-64 is defined as:
extern const union __float_u __nanf;
#define NAN __nanf.__val
Same here:
math.h:extern const union __float_u __nanf;
math.h:#define NAN __nanf.__val
I would guess that it's similar on mips. Is is possible that
NetBSD/mips has a conversion bug?What I don't get is that the code I used in ECPG and in this
test code is the same as in src/backend/utils/adt/float.c. E.g.:
float8in sees "NaN" -> value will be (double)NAN
float8out sees isnan(value) -> outputs "NaN" stringCan someone shed some light on why the backend
doesn't get the problem as above? :-(As Rémi says, isnan((double)(0.0 / 0.0)) == true for him.
Michael: IIRC, IEEE754 explicit about that the (0.0/0.0) division
produces NaN. How about doing it explicitely in ECPG?Rémi: please, run this code to confirm the above?
bash-4.1$ gcc -Wall -o nantest1 nantest1.c -lm
bash-4.1$ ./nantest1
computed NAN
1 0
defined INFINITY
0 1
Regards,
Rémi Zara
I wrote:
As R�mi says, isnan((double)(0.0 / 0.0)) == true for him.
Michael: IIRC, IEEE754 explicit about that the (0.0/0.0) division
produces NaN. How about doing it explicitely in ECPG?
I came up with three patches, they are attached.
Can you try whether the first patch (missing float.h from data.c)
solves the problem? And together with the 2nd one? In that
patch I fixed the order of float.h and math.h in nan_test.pgc,
which is the opposite of the order found in e.g. backend/utils/adt/float.c.
The 3rd patch is explicit about NetBSD/mips but it doesn't feel right.
They are working on Linux/x86-64 and NetBSD/x86-64. Can you try
the combinations below on "pika" outside the buildfarm whether they
still fail the ECPG make check?
- patch 1 by itself (12a)
- patch 1+2 (12a + 12-regr)
- patch 3 with/without 1+2
Sorry to give you work, but we don't have a mips machine.
Thanks in advance,
Zolt�n B�sz�rm�nyi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zolt�n B�sz�rm�nyi
Cybertec Sch�nig & Sch�nig GmbH
http://www.postgresql.at/
Attachments:
pg85-ecpg-fix-nan-inf-12a-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-12a-ctxdiff.patchDownload
*** pgsql/src/interfaces/ecpg/ecpglib/data.c~ 2010-02-25 13:11:56.000000000 +0100
--- pgsql/src/interfaces/ecpg/ecpglib/data.c 2010-02-25 13:11:56.000000000 +0100
***************
*** 5,10 ****
--- 5,11 ----
#include <stdlib.h>
#include <string.h>
+ #include <float.h>
#include <math.h>
#include "ecpgtype.h"
pg85-ecpg-fix-nan-inf-12-regr-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-12-regr-ctxdiff.patchDownload
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c
*** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-16 19:56:08.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-25 13:16:17.000000000 +0100
***************
*** 9,16 ****
#line 1 "nan_test.pgc"
#include <stdio.h>
#include <stdlib.h>
- #include <math.h>
#include <float.h>
#include <pgtypes_numeric.h>
#include <decimal.h>
--- 9,16 ----
#line 1 "nan_test.pgc"
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
+ #include <math.h>
#include <pgtypes_numeric.h>
#include <decimal.h>
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc
*** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-16 19:56:09.000000000 +0100
--- pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-25 13:15:07.000000000 +0100
***************
*** 1,7 ****
#include <stdio.h>
#include <stdlib.h>
- #include <math.h>
#include <float.h>
#include <pgtypes_numeric.h>
#include <decimal.h>
--- 1,7 ----
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
+ #include <math.h>
#include <pgtypes_numeric.h>
#include <decimal.h>
pg85-ecpg-fix-nan-inf-12-ctxdiff.patchtext/x-patch; name=pg85-ecpg-fix-nan-inf-12-ctxdiff.patchDownload
*** pgsql.orig/src/interfaces/ecpg/ecpglib/data.c 2010-02-04 11:10:03.000000000 +0100
--- pgsql/src/interfaces/ecpg/ecpglib/data.c 2010-02-25 12:57:49.000000000 +0100
***************
*** 85,94 ****
static double
get_float8_nan(void)
{
! #ifdef NAN
! return (double) NAN;
! #else
return (double) (0.0 / 0.0);
#endif
}
--- 85,94 ----
static double
get_float8_nan(void)
{
! #if !defined(NAN) || (defined(__NetBSD__) && defined(__mips__))
return (double) (0.0 / 0.0);
+ #else
+ return (double) NAN;
#endif
}
Boszormenyi Zoltan <zb@cybertec.at> writes:
Can you try whether the first patch (missing float.h from data.c)
solves the problem? And together with the 2nd one? In that
patch I fixed the order of float.h and math.h in nan_test.pgc,
which is the opposite of the order found in e.g. backend/utils/adt/float.c.
The 3rd patch is explicit about NetBSD/mips but it doesn't feel right.
The third patch is surely wrong. We don't need to do that in the
backend's instance of get_float8_nan, so ecpglib shouldn't need it
either.
I suspect that the ultimate cause of this is either one of the header
inclusion inconsistencies you found, or something associated with
not pulling in all the stuff that postgres.h does. port/netbsd.h
is empty though, so it's not immediately clear what might be missing.
regards, tom lane
Tom Lane �rta:
Boszormenyi Zoltan <zb@cybertec.at> writes:
Can you try whether the first patch (missing float.h from data.c)
solves the problem? And together with the 2nd one? In that
patch I fixed the order of float.h and math.h in nan_test.pgc,
which is the opposite of the order found in e.g. backend/utils/adt/float.c.The 3rd patch is explicit about NetBSD/mips but it doesn't feel right.
The third patch is surely wrong. We don't need to do that in the
backend's instance of get_float8_nan, so ecpglib shouldn't need it
either.I suspect that the ultimate cause of this is either one of the header
inclusion inconsistencies you found, or something associated with
not pulling in all the stuff that postgres.h does. port/netbsd.h
is empty though, so it's not immediately clear what might be missing.
ecpglib/data.c includes "postgres_fe.h", so it should be pulling
everything that's relevant from port/*, right?
Michael, can we try to install the first two patches?
They wouldn't hurt.
Thanks in advance,
Zolt�n B�sz�rm�nyi
--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics
----------------------------------
Zolt�n B�sz�rm�nyi
Cybertec Sch�nig & Sch�nig GmbH
http://www.postgresql.at/
Le 26 févr. 2010 à 12:12, Boszormenyi Zoltan a écrit :
ecpglib/data.c includes "postgres_fe.h", so it should be pulling
everything that's relevant from port/*, right?Michael, can we try to install the first two patches?
They wouldn't hurt.
I've tried patch 1 and 2, but they do not work. The fact is that the code is not used in the backend, because strtod("NaN", endptr) works. (isnan(strtod("NaN", endptr)) is true).
I should also note that isnan((double)nan("")) is true (works).
I will also report to NetBSD that isnan((double)NAN) does not work on mips.
Regards,
Rémi Zara
On Fri, Feb 26, 2010 at 12:12:10PM +0100, Boszormenyi Zoltan wrote:
Michael, can we try to install the first two patches?
If I understood the rest of the thread correctly this is not needed anymore,
right?
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
=?iso-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
I've tried patch 1 and 2, but they do not work. The fact is that the code is not used in the backend, because strtod("NaN", endptr) works. (isnan(strtod("NaN", endptr)) is true).
Hmm. So what do you get from
SELECT 'nan'::numeric::float8;
on that machine? That should exercise the backend's version of
get_float8_nan().
regards, tom lane
Michael Meskes <meskes@postgresql.org> writes:
On Fri, Feb 26, 2010 at 12:12:10PM +0100, Boszormenyi Zoltan wrote:
Michael, can we try to install the first two patches?
If I understood the rest of the thread correctly this is not needed anymore,
right?
I think it would be a good idea, just to have all that code using
identical #includes. R�mi's problem may be a platform bug rather
than something we can fix ourselves, but I think that making sure that
ecpg uses the exact same coding that's been proven in the backend
will forestall problems on other platforms.
regards, tom lane
Le 26 févr. 2010 à 17:11, Tom Lane a écrit :
=?iso-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
I've tried patch 1 and 2, but they do not work. The fact is that the code is not used in the backend, because strtod("NaN", endptr) works. (isnan(strtod("NaN", endptr)) is true).
Hmm. So what do you get from
SELECT 'nan'::numeric::float8;
on that machine? That should exercise the backend's version of
get_float8_nan().
regression=# select 'nan'::numeric::float8;
float8
----------
Infinity
(1 row)
So it is indeed the same behavior. Maybe that should be added to the regression tests.
So what's the best way to workaround the bug in NetBSD/mips ? (nan(""), (0.0/0.0), strtod("nan", null) ?)
Regards,
Rémi Zara
=?iso-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
Le 26 f�vr. 2010 � 17:11, Tom Lane a �crit :
Hmm. So what do you get from
SELECT 'nan'::numeric::float8;
regression=# select 'nan'::numeric::float8;
float8
----------
Infinity
(1 row)
So it is indeed the same behavior.
Yeah. So what it boils down to is that the platform has a NAN constant
but casting it to double produces the wrong thing. There's no doubt
that that's a bug in the floating-point support. You did say you'd
submitted it to the NetBSD folk right?
BTW, what about the float4 case, 'nan'::numeric::float4 ?
Maybe that should be added to the regression tests.
Perhaps. A lot of this stuff was never stress-tested in the past
because when it was put in, it was a crap shoot whether NaN (or Inf)
really worked on most platforms. Our attitude was "if it works for you,
great, but we're not going to sweat about it if it doesn't". I'm not
sure whether full IEEE float support has gotten sufficiently universal
to justify expecting more. I guess we could try it and see how many
other buildfarm members fail.
So what's the best way to workaround the bug in NetBSD/mips ?
I don't think it's our bug to fix.
regards, tom lane
Le 27 févr. 2010 à 17:57, Tom Lane a écrit :
=?iso-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
Le 26 févr. 2010 à 17:11, Tom Lane a écrit :
Hmm. So what do you get from
SELECT 'nan'::numeric::float8;regression=# select 'nan'::numeric::float8;
float8
----------
Infinity
(1 row)So it is indeed the same behavior.
Yeah. So what it boils down to is that the platform has a NAN constant
but casting it to double produces the wrong thing. There's no doubt
that that's a bug in the floating-point support. You did say you'd
submitted it to the NetBSD folk right?
I submitted it.
BTW, what about the float4 case, 'nan'::numeric::float4 ?
That works OK.
Maybe that should be added to the regression tests.
Perhaps. A lot of this stuff was never stress-tested in the past
because when it was put in, it was a crap shoot whether NaN (or Inf)
really worked on most platforms. Our attitude was "if it works for you,
great, but we're not going to sweat about it if it doesn't". I'm not
sure whether full IEEE float support has gotten sufficiently universal
to justify expecting more. I guess we could try it and see how many
other buildfarm members fail.So what's the best way to workaround the bug in NetBSD/mips ?
I don't think it's our bug to fix.
It would mean retiring pika until/if the bug is fixed... :-(
Regards,
Rémi Zara
=?iso-8859-1?Q?R=E9mi_Zara?= <remi_zara@mac.com> writes:
Le 27 f�vr. 2010 � 17:57, Tom Lane a �crit :
I don't think it's our bug to fix.
It would mean retiring pika until/if the bug is fixed... :-(
Grumble ... well, I suppose we've put in worse platform-specific hacks
elsewhere. At least this is pretty localized.
regards, tom lane
On Fri, Feb 26, 2010 at 11:14:01AM -0500, Tom Lane wrote:
I think it would be a good idea, just to have all that code using
identical #includes. R�mi's problem may be a platform bug rather
Sounds reasonable, done.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL