]> granicus.if.org Git - postgresql/commitdiff
Fixed array checking code for "unsigned long long" datatypes in libecpg.
authorMichael Meskes <meskes@postgresql.org>
Mon, 1 Aug 2016 04:36:27 +0000 (06:36 +0200)
committerMichael Meskes <meskes@postgresql.org>
Mon, 1 Aug 2016 13:08:12 +0000 (15:08 +0200)
src/interfaces/ecpg/ecpglib/data.c

index 82ab4aaf868853cce9c97ed7ef16f1f567547d3c..23646a957917b0794524f53f8c6ce84738bf77c6 100644 (file)
@@ -375,8 +375,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
 #ifdef HAVE_STRTOULL
                                case ECPGt_unsigned_long_long:
                                        *((unsigned long long int *) (var + offset * act_tuple)) = strtoull(pval, &scan_length, 10);
-                                       if ((isarray && *scan_length != ',' && *scan_length != '}')
-                                               || (!isarray && !(INFORMIX_MODE(compat) && *scan_length == '.') && *scan_length != '\0' && *scan_length != ' '))                /* Garbage left */
+                                       if (garbage_left(isarray, scan_length, compat))
                                        {
                                                ecpg_raise(lineno, ECPG_UINT_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
                                                return (false);