diff options
| author | Michael Meskes <meskes@postgresql.org> | 2000-05-17 06:03:14 +0000 |
|---|---|---|
| committer | Michael Meskes <meskes@postgresql.org> | 2000-05-17 06:03:14 +0000 |
| commit | e39a1186941200fdab0187e6022d714f41fc1945 (patch) | |
| tree | 6b40bf6b22a0b9bd8275c87622cf5bab134fa8fe /src/interfaces/ecpg/lib | |
| parent | 76da5b80b1424cbf467ec8871a264db3885efd53 (diff) | |
| download | postgresql-e39a1186941200fdab0187e6022d714f41fc1945.tar.gz | |
*** empty log message ***
Diffstat (limited to 'src/interfaces/ecpg/lib')
| -rw-r--r-- | src/interfaces/ecpg/lib/Makefile.in | 4 | ||||
| -rw-r--r-- | src/interfaces/ecpg/lib/data.c | 24 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/lib/Makefile.in b/src/interfaces/ecpg/lib/Makefile.in index 20f5c314dd..d48c75ea23 100644 --- a/src/interfaces/ecpg/lib/Makefile.in +++ b/src/interfaces/ecpg/lib/Makefile.in @@ -6,13 +6,13 @@ # Copyright (c) 1994, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.65 2000/03/30 11:41:34 meskes Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.66 2000/05/17 06:03:13 meskes Exp $ # #------------------------------------------------------------------------- NAME= ecpg SO_MAJOR_VERSION= 3 -SO_MINOR_VERSION= 1.0 +SO_MINOR_VERSION= 1.1 SRCDIR= @top_srcdir@ include $(SRCDIR)/Makefile.global diff --git a/src/interfaces/ecpg/lib/data.c b/src/interfaces/ecpg/lib/data.c index 29675a8972..18ac49805b 100644 --- a/src/interfaces/ecpg/lib/data.c +++ b/src/interfaces/ecpg/lib/data.c @@ -1,4 +1,5 @@ #include <stdlib.h> +#include <string.h> #include <ecpgtype.h> #include <ecpglib.h> @@ -26,8 +27,18 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno, ECPGraise(lineno, ECPG_DATA_NOT_ARRAY, NULL); return (false); } - else - ++pval; + + switch (type) + { + case ECPGt_char: + case ECPGt_unsigned_char: + case ECPGt_varchar: + break; + + default: + pval++; + break; + } } /* We will have to decode the value */ @@ -144,7 +155,14 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_double: if (pval) { - dres = strtod(pval, &scan_length); + if (isarray && *pval == '"') + dres = strtod(pval + 1, &scan_length); + else + dres = strtod(pval, &scan_length); + + if (isarray && *scan_length == '"') + scan_length++; + if ((isarray && *scan_length != ',' && *scan_length != '}') || (!isarray && *scan_length != '\0')) /* Garbage left */ { |
