1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Fixed NaN/Infinity problems in ECPG for float/double/numeric/decimal by making it OS independant.

Patch done by Zoltán Böszörményi.
This commit is contained in:
Michael Meskes
2010-02-02 16:09:12 +00:00
parent 63f9282f6e
commit cedae13017
14 changed files with 859 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.54 2010/01/26 09:07:31 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.55 2010/02/02 16:09:11 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@ -344,11 +344,11 @@ ECPGset_noind_null(enum ECPGttype type, void *ptr)
break;
case ECPGt_decimal:
memset((char *) ptr, 0, sizeof(decimal));
((decimal *) ptr)->sign = NUMERIC_NAN;
((decimal *) ptr)->sign = NUMERIC_NULL;
break;
case ECPGt_numeric:
memset((char *) ptr, 0, sizeof(numeric));
((numeric *) ptr)->sign = NUMERIC_NAN;
((numeric *) ptr)->sign = NUMERIC_NULL;
break;
case ECPGt_interval:
memset((char *) ptr, 0xff, sizeof(interval));
@ -416,11 +416,11 @@ ECPGis_noind_null(enum ECPGttype type, void *ptr)
return true;
break;
case ECPGt_decimal:
if (((decimal *) ptr)->sign == NUMERIC_NAN)
if (((decimal *) ptr)->sign == NUMERIC_NULL)
return true;
break;
case ECPGt_numeric:
if (((numeric *) ptr)->sign == NUMERIC_NAN)
if (((numeric *) ptr)->sign == NUMERIC_NULL)
return true;
break;
case ECPGt_interval: