Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix float parsing in ecpg INFORMIX mode.
authorMichael Meskes <meskes@postgresql.org>
Thu, 2 Nov 2017 19:46:34 +0000 (20:46 +0100)
committerMichael Meskes <meskes@postgresql.org>
Thu, 2 Nov 2017 19:51:23 +0000 (20:51 +0100)
src/interfaces/ecpg/ecpglib/data.c

index 86b2065bc02a0a31b1281f89806fdf5b53487b8f..3d83c2430c15ed173824561d34e57f038645fde2 100644 (file)
@@ -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;
        }
 
@@ -403,7 +403,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);