postgres.git / summary / log / commit / refs
commit 7a35507acceb07c4ed1a7a0c82db50eee3101df3
Author: Michael Meskes <meskes@postgresql.org>
Date: Thu Nov 02 19:46:34 2017 +0000
First released in: 11.0, 9.3.20, 9.4.15, 9.5.10, 9.6.6, 10.1
Fix float parsing in ecpg INFORMIX mode.
src/interfaces/ecpg/ecpglib/data.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index 46eda33241e..4c9cdccdc0a 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -59,7 +59,7 @@ garbage_left(enum ARRAY_TYPE isarray, char **scan_length, enum COMPAT_MODE compa
/* skip invalid characters */
do {
(*scan_length)++;
- } while (**scan_length != ' ' && **scan_length != '\0' && isdigit(**scan_length));
+ } while (isdigit(**scan_length));
return false;
}
@@ -402,7 +402,8 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (isarray && *scan_length == '"')
scan_length++;
- if (garbage_left(isarray, &scan_length, compat))
+ /* no special INFORMIX treatment for floats */
+ if (garbage_left(isarray, &scan_length, ECPG_COMPAT_PGSQL))
{
ecpg_raise(lineno, ECPG_FLOAT_FORMAT,
ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
[parent: f05ae2fa94b4]