diff options
author | Michael Meskes <meskes@postgresql.org> | 2003-09-19 14:06:21 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2003-09-19 14:06:21 +0000 |
commit | df974272ec81af7092370deea6d689565fe6f0c3 (patch) | |
tree | bf3533eab7e7b3c4d93f1dc418929e8c7ac08c7e /src/interfaces/ecpg/ecpglib/data.c | |
parent | 689015748f8dd7267355eb6b7088684183fc1159 (diff) | |
download | postgresql-df974272ec81af7092370deea6d689565fe6f0c3.tar.gz postgresql-df974272ec81af7092370deea6d689565fe6f0c3.zip |
Removed superfluous return statement in get_data.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/data.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/data.c | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index dfe6e6e6e5e..8be86b0bc2d 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.18 2003/09/18 13:12:23 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.19 2003/09/19 14:06:21 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -397,7 +397,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, { /* Informix wants its own NULL value here instead of an error */ ECPGset_informix_null(ECPGt_numeric, &nres); - return (true); } else { @@ -405,14 +404,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, return (false); } } - if (isarray && *scan_length == '"') - scan_length++; - - if ((isarray && *scan_length != ',' && *scan_length != '}') - || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + else { - ECPGraise(lineno, ECPG_NUMERIC_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); - return (false); + if (isarray && *scan_length == '"') + scan_length++; + + if ((isarray && *scan_length != ',' && *scan_length != '}') + || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + { + ECPGraise(lineno, ECPG_NUMERIC_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); + return (false); + } } } else @@ -439,7 +441,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, { /* Informix wants its own NULL value here instead of an error */ ECPGset_informix_null(ECPGt_interval, &ires); - return (true); } else { @@ -447,14 +448,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, return (false); } } - if (isarray && *scan_length == '"') - scan_length++; - - if ((isarray && *scan_length != ',' && *scan_length != '}') - || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + else { - ECPGraise(lineno, ECPG_INTERVAL_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); - return (false); + if (isarray && *scan_length == '"') + scan_length++; + + if ((isarray && *scan_length != ',' && *scan_length != '}') + || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + { + ECPGraise(lineno, ECPG_INTERVAL_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); + return (false); + } } } else @@ -477,7 +481,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, { /* Informix wants its own NULL value here instead of an error */ ECPGset_informix_null(ECPGt_date, &ddres); - return (true); } else { @@ -485,15 +488,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, return (false); } } - - if (isarray && *scan_length == '"') - scan_length++; - - if ((isarray && *scan_length != ',' && *scan_length != '}') - || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + else { - ECPGraise(lineno, ECPG_DATE_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); - return (false); + if (isarray && *scan_length == '"') + scan_length++; + + if ((isarray && *scan_length != ',' && *scan_length != '}') + || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + { + ECPGraise(lineno, ECPG_DATE_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); + return (false); + } } *((date *) (var + offset * act_tuple)) = ddres; @@ -515,7 +520,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, { /* Informix wants its own NULL value here instead of an error */ ECPGset_informix_null(ECPGt_timestamp, &tres); - return (true); } else { @@ -523,14 +527,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno, return (false); } } - if (isarray && *scan_length == '"') - scan_length++; - - if ((isarray && *scan_length != ',' && *scan_length != '}') - || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + else { - ECPGraise(lineno, ECPG_TIMESTAMP_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); - return (false); + if (isarray && *scan_length == '"') + scan_length++; + + if ((isarray && *scan_length != ',' && *scan_length != '}') + || (!isarray && *scan_length != '\0' && *scan_length != ' ')) /* Garbage left */ + { + ECPGraise(lineno, ECPG_TIMESTAMP_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval); + return (false); + } } *((timestamp *) (var + offset * act_tuple)) = tres; |