diff options
author | Michael Meskes <meskes@postgresql.org> | 2005-08-24 10:34:19 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2005-08-24 10:34:19 +0000 |
commit | f417ebf03a71c9ca1043850ad99d46675c60d2b0 (patch) | |
tree | 5c6ad4d49c7a5272c1a3d44a06afc67ac9bc1d14 /src/interfaces/ecpg/ecpglib/data.c | |
parent | 9012bb63fdf072b60c565fdcad9068bd603d8897 (diff) | |
download | postgresql-f417ebf03a71c9ca1043850ad99d46675c60d2b0.tar.gz postgresql-f417ebf03a71c9ca1043850ad99d46675c60d2b0.zip |
- Check for NULL before checking whether argument is an array.
- Remove stary character from string quoting.
- Fixed check to report missing varchar pointer implementation.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/data.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/data.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index 25738796fb2..252fbae3552 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.27 2004/08/29 05:06:59 momjian Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.28 2005/08/24 10:34:19 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -50,29 +50,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, ECPGlog("ECPGget_data line %d: RESULT: %s offset: %ld array: %s\n", lineno, pval ? pval : "", offset, isarray ? "Yes" : "No"); - /* pval is a pointer to the value */ - /* let's check if it really is an array if it should be one */ - if (isarray == ECPG_ARRAY_ARRAY) - { - if (*pval != '{') - { - ECPGraise(lineno, ECPG_DATA_NOT_ARRAY, ECPG_SQLSTATE_DATATYPE_MISMATCH, NULL); - return (false); - } - - switch (type) - { - case ECPGt_char: - case ECPGt_unsigned_char: - case ECPGt_varchar: - break; - - default: - pval++; - break; - } - } - /* We will have to decode the value */ /* @@ -129,6 +106,29 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, if (value_for_indicator == -1) return (true); + /* pval is a pointer to the value */ + /* let's check if it really is an array if it should be one */ + if (isarray == ECPG_ARRAY_ARRAY) + { + if (*pval != '{') + { + ECPGraise(lineno, ECPG_DATA_NOT_ARRAY, ECPG_SQLSTATE_DATATYPE_MISMATCH, NULL); + return (false); + } + + switch (type) + { + case ECPGt_char: + case ECPGt_unsigned_char: + case ECPGt_varchar: + break; + + default: + pval++; + break; + } + } + do { switch (type) |