diff --git a/src/common/backend/utils/adt/int.cpp b/src/common/backend/utils/adt/int.cpp index 43df03da22fe4ef0f5240a726e053dd914dc684f..e1526182e4f5485ce5466bb32f0bfb3f2ab42c1c 100644 --- a/src/common/backend/utils/adt/int.cpp +++ b/src/common/backend/utils/adt/int.cpp @@ -50,6 +50,135 @@ typedef struct { int32 step; } generate_series_fctx; + + +static inline void CheckSpaceAndDotInternal(char& digitAfterDot, const char** ptr, bool checkDecimal = true, int endChar = '\0') +{ + if (checkDecimal && **ptr == '.') { + (*ptr)++; + while (**ptr != '\0' && **ptr != endChar && isdigit(**ptr)) { + if (digitAfterDot == '\0') { + digitAfterDot = **ptr; + } + (*ptr)++; + } + } + + while (**ptr != '\0' && **ptr != endChar) { + if (!isspace(**ptr)) { + return; + } + (*ptr)++; + } +} + + +template +int64 PgStrToIntInternal(const char* s, bool errOk, uint64 max, int64 min, const char* typname) +{ + const char* ptr = s; + int128 tmp = 0; + bool neg = false; + char digitAfterDot = '\0'; + int errlevel = errOk ? WARNING : ERROR; + const int baseDecimal = 10; + + if (*s == 0) { + goto invalid_syntax; + } + + /* skip leading spaces */ + while (likely(*ptr) && isspace((unsigned char)*ptr)) { + ptr++; + } + + /* handle sign */ + if (*ptr == '-') { + ptr++; + neg = true; + } else if (*ptr == '+') + ptr++; + + /* require at least one digit */ + if (unlikely(!isdigit((unsigned char)*ptr))) { + goto invalid_syntax; + } + + /* process digits */ + while (*ptr && isdigit((unsigned char)*ptr)) { + int8 digit = (*ptr++ - '0'); + if (is_unsigned) { + tmp = tmp * baseDecimal + digit; + if (tmp > max) { + goto out_of_range; + } + } else { + tmp = tmp * baseDecimal - digit; + if (tmp < min || tmp > max) { + goto out_of_range; + } + } + } + + /* allow trailing whitespace, but not other trailing chars */ + CheckSpaceAndDotInternal(digitAfterDot, &ptr); + + /* could fail if input is most negative number */ + if (is_unsigned) { + if (neg && tmp > min) { + goto out_of_range; + } + } else if (!neg) { + if (unlikely(tmp == min)) { + goto out_of_range; + } + tmp = -tmp; + } + + if ((isdigit(digitAfterDot)) && digitAfterDot >= '5') { + if (is_unsigned) { + if (tmp == max) { + ereport(errlevel, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for type %s", s, typname))); + } + if (!neg && tmp < max) { + tmp++; + } + } else { + if (tmp == max || tmp == min) { + ereport(errlevel, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for type %s", s, typname))); + } + if (!neg && tmp < max) { + tmp++; + } else if (neg && tmp > min) { + tmp--; + } + } + } + + /* we check *ptr at last */ + if (unlikely(*ptr != '\0')) { + goto invalid_syntax; + } + + return (int64)tmp; + +out_of_range: + ereport(errlevel, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for type %s", s, typname))); + return neg ? min : (int64)max; + +invalid_syntax: + ereport(errlevel, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for %s: \"%s\"", typname, s))); + return (int64)tmp; +} + + + /***************************************************************************** * USER I/O ROUTINES * *****************************************************************************/ @@ -60,8 +189,12 @@ typedef struct { Datum int2in(PG_FUNCTION_ARGS) { char* num = PG_GETARG_CSTRING(0); - - PG_RETURN_INT16(pg_strtoint16(num, fcinfo->can_ignore)); + if (DB_IS_CMPT(A_FORMAT)) { + PG_RETURN_INT16(PgStrToIntInternal(num, fcinfo->can_ignore, + PG_INT16_MAX, PG_INT16_MIN, "smallint")); + } else { + PG_RETURN_INT16(pg_strtoint16(num, fcinfo->can_ignore)); + } } /* @@ -296,7 +429,12 @@ Datum int4in(PG_FUNCTION_ARGS) { char* num = PG_GETARG_CSTRING(0); - PG_RETURN_INT32(pg_strtoint32(num, fcinfo->can_ignore)); + if (DB_IS_CMPT(A_FORMAT)) { + PG_RETURN_INT32(PgStrToIntInternal(num, fcinfo->can_ignore, + PG_INT32_MAX, PG_INT32_MIN, "integer")); + } else { + PG_RETURN_INT32(pg_strtoint32(num, fcinfo->can_ignore)); + } } /* @@ -1223,8 +1361,12 @@ Datum generate_series_step_int4(PG_FUNCTION_ARGS) Datum int1in(PG_FUNCTION_ARGS) { char* num = PG_GETARG_CSTRING(0); - - PG_RETURN_UINT8((uint8)pg_atoi(num, sizeof(uint8), '\0', fcinfo->can_ignore)); + if (DB_IS_CMPT(A_FORMAT)) { + PG_RETURN_UINT8(PgStrToIntInternal(num, fcinfo->can_ignore, + PG_UINT8_MAX, 0, "tinyint")); + } else { + PG_RETURN_UINT8((uint8)pg_atoi(num, sizeof(uint8), '\0', fcinfo->can_ignore)); + } } // int1out - converts uint8 to "num" diff --git a/src/common/backend/utils/adt/int8.cpp b/src/common/backend/utils/adt/int8.cpp index 3228d431e04a19c0325f4abd480e334177aa1f87..be753ff0a9d9b6a27929a7625dad86a04b18296e 100644 --- a/src/common/backend/utils/adt/int8.cpp +++ b/src/common/backend/utils/adt/int8.cpp @@ -33,6 +33,12 @@ typedef struct { int64 step; } generate_series_fctx; + +template +extern int64 PgStrToIntInternal(const char* s, bool errOk, uint64 max, int64 min, const char* typname); + + + /*********************************************************************** ** ** Routines for 64-bit integers. @@ -154,8 +160,12 @@ Datum int8in(PG_FUNCTION_ARGS) { char* str = PG_GETARG_CSTRING(0); int64 result; - - (void)scanint8(str, false, &result, fcinfo->can_ignore); + if (DB_IS_CMPT(A_FORMAT)) { + result = PgStrToIntInternal(str, fcinfo->can_ignore, + PG_INT64_MAX, PG_INT64_MIN, "bigint"); + } else { + (void)scanint8(str, false, &result, fcinfo->can_ignore); + } PG_RETURN_INT64(result); } diff --git a/src/test/regress/expected/accept_empty_str.out b/src/test/regress/expected/accept_empty_str.out index e3eff0d936f65a3bf7171bd60cee174fe84c63cd..bc07c00966a12888a6be72f1d876d36eb71adce4 100644 --- a/src/test/regress/expected/accept_empty_str.out +++ b/src/test/regress/expected/accept_empty_str.out @@ -144,7 +144,7 @@ select '123'::int1 is null; (1 row) select ''::int1 is null; -ERROR: invalid input syntax for integer: "" +ERROR: invalid input syntax for tinyint: "" LINE 1: select ''::int1 is null; ^ select '123'::int2 is null; @@ -154,7 +154,7 @@ select '123'::int2 is null; (1 row) select ''::int2 is null; -ERROR: invalid input syntax for integer: "" +ERROR: invalid input syntax for smallint: "" LINE 1: select ''::int2 is null; ^ select '123'::int is null; @@ -174,7 +174,7 @@ select '123'::int8 is null; (1 row) select ''::int8 is null; -ERROR: invalid input syntax for type bigint: "" +ERROR: invalid input syntax for bigint: "" LINE 1: select ''::int8 is null; ^ select '123'::float4 is null; diff --git a/src/test/regress/expected/b_compatibility.out b/src/test/regress/expected/b_compatibility.out index 5114f3657ec6e792800811132f46b82b8c1b5428..8412db789d906d06df2721984f41facf78607102 100644 --- a/src/test/regress/expected/b_compatibility.out +++ b/src/test/regress/expected/b_compatibility.out @@ -125,7 +125,7 @@ drop table text2; -- test int8 int1in int2in int4in \c regression select '-'::int8; -ERROR: invalid input syntax for type bigint: "-" +ERROR: invalid input syntax for bigint: "-" LINE 1: select '-'::int8; ^ CONTEXT: referenced column: int8 @@ -136,10 +136,10 @@ select int1in(''); (1 row) select int1in('.1'); -ERROR: invalid input syntax for integer: ".1" +ERROR: invalid input syntax for tinyint: ".1" CONTEXT: referenced column: int1in select int2in('s'); -ERROR: invalid input syntax for integer: "s" +ERROR: invalid input syntax for smallint: "s" CONTEXT: referenced column: int2in select int4in('s'); ERROR: invalid input syntax for integer: "s" diff --git a/src/test/regress/expected/decode_compatible_with_o.out b/src/test/regress/expected/decode_compatible_with_o.out index 1f9acd33f703d8c223194104fe9f78b8915411d4..37cfd88f3f869261b20ad03c2bf7cfe9560bc1b6 100755 --- a/src/test/regress/expected/decode_compatible_with_o.out +++ b/src/test/regress/expected/decode_compatible_with_o.out @@ -8560,8 +8560,11 @@ select decode('1.0', 1, 'same', 'different'); (1 row) select decode(1, '1.0'::text, 'same', 'different'); -ERROR: invalid input syntax for type bigint: "1.0" -CONTEXT: referenced column: case + case +------ + same +(1 row) + select decode('1.0'::text, 1, 'same', 'different'); case ------ @@ -8569,38 +8572,54 @@ select decode('1.0'::text, 1, 'same', 'different'); (1 row) select case 1 when '1.0' then 'same' else 'different' end; -ERROR: invalid input syntax for integer: "1.0" -LINE 1: select case 1 when '1.0' then 'same' else 'different' end; - ^ -CONTEXT: referenced column: case + case +------ + same +(1 row) + select case '1.0' when 1 then 'same' else 'different' end; -ERROR: invalid input syntax for type bigint: "1.0" -CONTEXT: referenced column: case + case +------ + same +(1 row) + set sql_beta_feature = 'none'; select decode(1, '1.0', 'same', 'different'); -ERROR: invalid input syntax for integer: "1.0" -LINE 1: select decode(1, '1.0', 'same', 'different'); - ^ -CONTEXT: referenced column: case + case +------ + same +(1 row) + select decode('1.0', 1, 'same', 'different'); -ERROR: invalid input syntax for integer: "1.0" -LINE 1: select decode('1.0', 1, 'same', 'different'); - ^ -CONTEXT: referenced column: case + case +------ + same +(1 row) + select decode(1, '1.0'::text, 'same', 'different'); -ERROR: invalid input syntax for type bigint: "1.0" -CONTEXT: referenced column: case + case +------ + same +(1 row) + select decode('1.0'::text, 1, 'same', 'different'); -ERROR: invalid input syntax for type bigint: "1.0" -CONTEXT: referenced column: case + case +------ + same +(1 row) + select case 1 when '1.0' then 'same' else 'different' end; -ERROR: invalid input syntax for integer: "1.0" -LINE 1: select case 1 when '1.0' then 'same' else 'different' end; - ^ -CONTEXT: referenced column: case + case +------ + same +(1 row) + select case '1.0' when 1 then 'same' else 'different' end; -ERROR: invalid input syntax for type bigint: "1.0" -CONTEXT: referenced column: case + case +------ + same +(1 row) + set sql_beta_feature = 'none'; create table base_tab_000 ( col_tinyint tinyint, diff --git a/src/test/regress/expected/enable_expr_fusion_flatten.out b/src/test/regress/expected/enable_expr_fusion_flatten.out index 4c7cca0d76b9b25a7b91a8368491dbdc377817d0..f78fc6b056934b9fb0beeba68e434673af33f745 100644 --- a/src/test/regress/expected/enable_expr_fusion_flatten.out +++ b/src/test/regress/expected/enable_expr_fusion_flatten.out @@ -253,10 +253,6 @@ INSERT INTO INT4_FLT(f1) VALUES (' 0 '); INSERT INTO INT4_FLT(f1) VALUES ('123456 '); INSERT INTO INT4_FLT(f1) VALUES (' -123456'); INSERT INTO INT4_FLT(f1) VALUES ('34.5'); -ERROR: invalid input syntax for integer: "34.5" -LINE 1: INSERT INTO INT4_FLT(f1) VALUES ('34.5'); - ^ -CONTEXT: referenced column: f1 -- largest and smallest values INSERT INTO INT4_FLT(f1) VALUES ('2147483647'); INSERT INTO INT4_FLT(f1) VALUES ('-2147483647'); diff --git a/src/test/regress/expected/expr_nantest_infinitetest.out b/src/test/regress/expected/expr_nantest_infinitetest.out index 156b093826a05570d323ec0aa839cba5a269c49a..50e4bd96c24a87afa6b5d54b508123fbeb4a67a3 100644 --- a/src/test/regress/expected/expr_nantest_infinitetest.out +++ b/src/test/regress/expected/expr_nantest_infinitetest.out @@ -636,7 +636,7 @@ SELECT c1, c2, c3, c4, c5 FROM tnf WHERE (c3 + 1) IS NOT NAN; (4 rows) SELECT c1, c2, c3, c4, c5 FROM tnf WHERE (c4 + 1) IS NOT NAN; -- error -ERROR: invalid input syntax for type bigint: "1234.5679" +ERROR: invalid input syntax for bigint: "-1.79E+100" SELECT (SELECT c3 FROM tnf WHERE c1 = 3) IS NAN; ?column? ---------- @@ -1292,7 +1292,7 @@ SELECT c1, c2, c3, c4, c5 FROM tnf WHERE (c3 + 1) IS NOT NAN; (4 rows) SELECT c1, c2, c3, c4, c5 FROM tnf WHERE (c4 + 1) IS NOT NAN; -- error -ERROR: invalid input syntax for type bigint: "1234.5679" +ERROR: invalid input syntax for bigint: "-1.79E+100" SELECT (SELECT c3 FROM tnf WHERE c1 = 3) IS NAN; ?column? ---------- diff --git a/src/test/regress/expected/hw_datatype.out b/src/test/regress/expected/hw_datatype.out index 502000a34621bdb249bf1fccbf54039407b2c553..87bd4045c0f1039fa2b94832dad637e13b29a224 100644 --- a/src/test/regress/expected/hw_datatype.out +++ b/src/test/regress/expected/hw_datatype.out @@ -1617,18 +1617,33 @@ CONTEXT: referenced column: implicit_conversion_063 --select int8 function drop function FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(FLOAT4); select FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(cast('123.456' as text)); -ERROR: invalid input syntax for type bigint: "123.456" +INFO: INT8 type value is 123 CONTEXT: referenced column: implicit_conversion_063 + implicit_conversion_063 +------------------------- + +(1 row) + --select int4 function drop function FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(INT8); select FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(cast('123.56' as text)); -ERROR: invalid input syntax for integer: "123.56" +INFO: INT4 type value is 124 CONTEXT: referenced column: implicit_conversion_063 + implicit_conversion_063 +------------------------- + +(1 row) + --select int2 function drop function FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(INT4); select FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(cast('123.456' as text)); -ERROR: invalid input syntax for integer: "123.456" +INFO: INT2 type value is 123 CONTEXT: referenced column: implicit_conversion_063 + implicit_conversion_063 +------------------------- + +(1 row) + --select raw function, failed! donot have text to raw implicit cast drop function FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(INT2); select FVT_GAUSSDB_ADAPT_1.IMPLICIT_CONVERSION_063(cast('123' as text)); @@ -1695,71 +1710,70 @@ INSERT INTO TINYINT_TBL(f1) VALUES ('255'); INSERT INTO TINYINT_TBL(f1) VALUES ('0'); -- bad input values -- should give errors INSERT INTO TINYINT_TBL(f1) VALUES (' -1'); -ERROR: value " -1" is out of range for 8-bit integer +ERROR: value " -1" is out of range for type tinyint LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES (' -1'); ^ CONTEXT: referenced column: f1 INSERT INTO TINYINT_TBL(f1) VALUES ('256'); -ERROR: value "256" is out of range for 8-bit integer +ERROR: value "256" is out of range for type tinyint LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES ('256'); ^ CONTEXT: referenced column: f1 INSERT INTO TINYINT_TBL(f1) VALUES ('asdf'); -ERROR: invalid input syntax for integer: "asdf" +ERROR: invalid input syntax for tinyint: "asdf" LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES ('asdf'); ^ CONTEXT: referenced column: f1 INSERT INTO TINYINT_TBL(f1) VALUES (' '); -ERROR: invalid input syntax for integer: " " +ERROR: invalid input syntax for tinyint: " " LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES (' '); ^ CONTEXT: referenced column: f1 INSERT INTO TINYINT_TBL(f1) VALUES (' asdf '); -ERROR: invalid input syntax for integer: " asdf " +ERROR: invalid input syntax for tinyint: " asdf " LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES (' asdf '); ^ CONTEXT: referenced column: f1 INSERT INTO TINYINT_TBL(f1) VALUES ('- 1234'); -ERROR: invalid input syntax for integer: "- 1234" +ERROR: invalid input syntax for tinyint: "- 1234" LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES ('- 1234'); ^ CONTEXT: referenced column: f1 INSERT INTO TINYINT_TBL(f1) VALUES ('123 5'); -ERROR: invalid input syntax for integer: "123 5" +ERROR: invalid input syntax for tinyint: "123 5" LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES ('123 5'); ^ CONTEXT: referenced column: f1 INSERT INTO TINYINT_TBL(f1) VALUES ('34.5'); -ERROR: invalid input syntax for integer: "34.5" -LINE 1: INSERT INTO TINYINT_TBL(f1) VALUES ('34.5'); - ^ -CONTEXT: referenced column: f1 SELECT '' AS six, * FROM TINYINT_TBL ORDER BY 1,2; six | f1 -----+----- | 0 | 20 + | 35 | 124 | 255 | | -(6 rows) +(7 rows) SELECT '' AS three, i.* FROM TINYINT_TBL i WHERE i.f1 <> int2 '0' ORDER BY 1,2; three | f1 -------+----- | 20 + | 35 | 124 | 255 -(3 rows) +(4 rows) SELECT '' AS three, i.* FROM TINYINT_TBL i WHERE i.f1 <> tinyint '0' ORDER BY 1,2; three | f1 -------+----- | 20 + | 35 | 124 | 255 -(3 rows) +(4 rows) SELECT '' AS one, i.* FROM TINYINT_TBL i WHERE i.f1 = int2 '0' ORDER BY 1,2; one | f1 @@ -1799,42 +1813,47 @@ SELECT '' AS three, i.* FROM TINYINT_TBL i WHERE i.f1 > int2 '0' ORDER BY 1,2; three | f1 -------+----- | 20 + | 35 | 124 | 255 -(3 rows) +(4 rows) SELECT '' AS three, i.* FROM TINYINT_TBL i WHERE i.f1 > tinyint '0' ORDER BY 1,2; three | f1 -------+----- | 20 + | 35 | 124 | 255 -(3 rows) +(4 rows) SELECT '' AS four, i.* FROM TINYINT_TBL i WHERE i.f1 >= int2 '0' ORDER BY 1,2; four | f1 ------+----- | 0 | 20 + | 35 | 124 | 255 -(4 rows) +(5 rows) SELECT '' AS four, i.* FROM TINYINT_TBL i WHERE i.f1 >= tinyint '0' ORDER BY 1,2; four | f1 ------+----- | 0 | 20 + | 35 | 124 | 255 -(4 rows) +(5 rows) -- positive odds SELECT '' AS one, i.* FROM TINYINT_TBL i WHERE (i.f1 % int2 '2') = int2 '1' ORDER BY 1,2; one | f1 -----+----- + | 35 | 255 -(1 row) +(2 rows) -- any evens SELECT '' AS three, i.* FROM TINYINT_TBL i WHERE (i.f1 % int4 '2') = int2 '0' ORDER BY 1,2; @@ -1850,11 +1869,12 @@ SELECT '' AS out_limit, i.f1, i.f1 * tinyint '2' AS x FROM TINYINT_TBL i ORDER B -----------+-----+----- | 0 | 0 | 20 | 40 + | 35 | 70 | 124 | 248 | 255 | 510 | | | | -(6 rows) +(7 rows) SELECT '' AS three, i.f1, i.f1 * tinyint '2' AS x FROM TINYINT_TBL i WHERE abs(f1) < 128 ORDER BY 1,2; @@ -1862,19 +1882,21 @@ WHERE abs(f1) < 128 ORDER BY 1,2; -------+-----+----- | 0 | 0 | 20 | 40 + | 35 | 70 | 124 | 248 -(3 rows) +(4 rows) SELECT '' AS out_limit, i.f1, i.f1 + tinyint '1' AS x FROM TINYINT_TBL i ORDER BY 1,2; out_limit | f1 | x -----------+-----+----- | 0 | 1 | 20 | 21 + | 35 | 36 | 124 | 125 | 255 | 256 | | | | -(6 rows) +(7 rows) SELECT '' AS three, i.f1, i.f1 + tinyint '1' AS x FROM TINYINT_TBL i WHERE f1 < 255 ORDER BY 1,2; @@ -1882,19 +1904,21 @@ WHERE f1 < 255 ORDER BY 1,2; -------+-----+----- | 0 | 1 | 20 | 21 + | 35 | 36 | 124 | 125 -(3 rows) +(4 rows) SELECT '' AS out_limit, i.f1, i.f1 - tinyint '1' AS x FROM TINYINT_TBL i ORDER BY 1,2; out_limit | f1 | x -----------+-----+----- | 0 | -1 | 20 | 19 + | 35 | 34 | 124 | 123 | 255 | 254 | | | | -(6 rows) +(7 rows) SELECT '' AS three, i.f1, i.f1 - tinyint '1' AS x FROM TINYINT_TBL ORDER BY 1,2i WHERE f1 > 0; @@ -1906,33 +1930,36 @@ SELECT '' AS two, i.f1, i.f1 - int4 '1' AS x FROM TINYINT_TBL i ORDER BY 1,2; -----+-----+----- | 0 | -1 | 20 | 19 + | 35 | 34 | 124 | 123 | 255 | 254 | | | | -(6 rows) +(7 rows) SELECT '' AS six, i.f1, i.f1 / int2 '2' AS x FROM TINYINT_TBL i ORDER BY 1,2; six | f1 | x -----+-----+------- | 0 | 0 | 20 | 10 + | 35 | 17.5 | 124 | 62 | 255 | 127.5 | | | | -(6 rows) +(7 rows) SELECT '' AS six, i.f1, i.f1 / int4 '2' AS x FROM TINYINT_TBL i ORDER BY 1,2; six | f1 | x -----+-----+------- | 0 | 0 | 20 | 10 + | 35 | 17.5 | 124 | 62 | 255 | 127.5 | | | | -(6 rows) +(7 rows) SELECT ''AS two, * FROM TINYINT_TBL WHERE f1 is null ORDER BY 1,2; two | f1 diff --git a/src/test/regress/expected/ignore/ignore_not_null_constraints.out b/src/test/regress/expected/ignore/ignore_not_null_constraints.out index 51d80eb96b0531423de2d0a477b6073d65630c1e..5888ac8ed6a0f13ca4970079145beba78a2c8138 100644 --- a/src/test/regress/expected/ignore/ignore_not_null_constraints.out +++ b/src/test/regress/expected/ignore/ignore_not_null_constraints.out @@ -1112,8 +1112,7 @@ explain(costs off) insert /*+ ignore_error */ into t_not_null_key_partition val (3 rows) insert /*+ ignore_error */ into t_not_null_key_partition values (null); -WARNING: null value in column "num" violates not-null constraint -DETAIL: Failing row contains (null, null). +WARNING: inserted partition key does not map to any table partition select * from t_not_null_key_partition; num | ca_city -----+---------- diff --git a/src/test/regress/expected/mysql_compatibility.out b/src/test/regress/expected/mysql_compatibility.out index 19b172d15f721d97ba5b6a55853104bce66c38a1..d161990b37bdb04979630fcc89300c3445450bb4 100644 --- a/src/test/regress/expected/mysql_compatibility.out +++ b/src/test/regress/expected/mysql_compatibility.out @@ -125,7 +125,7 @@ drop table text2; -- test int8 int1in int2in int4in \c regression select '-'::int8; -ERROR: invalid input syntax for type bigint: "-" +ERROR: invalid input syntax for bigint: "-" LINE 1: select '-'::int8; ^ CONTEXT: referenced column: int8 @@ -136,10 +136,10 @@ select int1in(''); (1 row) select int1in('.1'); -ERROR: invalid input syntax for integer: ".1" +ERROR: invalid input syntax for tinyint: ".1" CONTEXT: referenced column: int1in select int2in('s'); -ERROR: invalid input syntax for integer: "s" +ERROR: invalid input syntax for smallint: "s" CONTEXT: referenced column: int2in select int4in('s'); ERROR: invalid input syntax for integer: "s" diff --git a/src/test/regress/expected/single_node_int2.out b/src/test/regress/expected/single_node_int2.out index 8e28e1326e6c7003d580ab7f9e5061cf0d9ac75c..2fa5c9aa220085f8b957df0cfe5fb972b0c99aa7 100644 --- a/src/test/regress/expected/single_node_int2.out +++ b/src/test/regress/expected/single_node_int2.out @@ -6,10 +6,6 @@ INSERT INTO INT2_TBL(f1) VALUES ('0 '); INSERT INTO INT2_TBL(f1) VALUES (' 1234 '); INSERT INTO INT2_TBL(f1) VALUES (' -1234'); INSERT INTO INT2_TBL(f1) VALUES ('34.5'); -ERROR: invalid input syntax for integer: "34.5" -LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('34.5'); - ^ -CONTEXT: referenced column: f1 -- largest and smallest values INSERT INTO INT2_TBL(f1) VALUES ('32767'); INSERT INTO INT2_TBL(f1) VALUES ('-32767'); @@ -20,27 +16,27 @@ LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('100000'); ^ CONTEXT: referenced column: f1 INSERT INTO INT2_TBL(f1) VALUES ('asdf'); -ERROR: invalid input syntax for integer: "asdf" +ERROR: invalid input syntax for smallint: "asdf" LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('asdf'); ^ CONTEXT: referenced column: f1 INSERT INTO INT2_TBL(f1) VALUES (' '); -ERROR: invalid input syntax for integer: " " +ERROR: invalid input syntax for smallint: " " LINE 1: INSERT INTO INT2_TBL(f1) VALUES (' '); ^ CONTEXT: referenced column: f1 INSERT INTO INT2_TBL(f1) VALUES ('- 1234'); -ERROR: invalid input syntax for integer: "- 1234" +ERROR: invalid input syntax for smallint: "- 1234" LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('- 1234'); ^ CONTEXT: referenced column: f1 INSERT INTO INT2_TBL(f1) VALUES ('4 444'); -ERROR: invalid input syntax for integer: "4 444" +ERROR: invalid input syntax for smallint: "4 444" LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('4 444'); ^ CONTEXT: referenced column: f1 INSERT INTO INT2_TBL(f1) VALUES ('123 dt'); -ERROR: invalid input syntax for integer: "123 dt" +ERROR: invalid input syntax for smallint: "123 dt" LINE 1: INSERT INTO INT2_TBL(f1) VALUES ('123 dt'); ^ CONTEXT: referenced column: f1 @@ -51,28 +47,31 @@ SELECT '' AS five, * FROM INT2_TBL; | 0 | 1234 | -1234 + | 35 | 32767 | -32767 | -(6 rows) +(7 rows) SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> int2 '0'; four | f1 ------+-------- | 1234 | -1234 + | 35 | 32767 | -32767 -(4 rows) +(5 rows) SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> int4 '0'; four | f1 ------+-------- | 1234 | -1234 + | 35 | 32767 | -32767 -(4 rows) +(5 rows) SELECT '' AS one, i.* FROM INT2_TBL i WHERE i.f1 = int2 '0'; one | f1 @@ -120,38 +119,43 @@ SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > int2 '0'; two | f1 -----+------- | 1234 + | 35 | 32767 -(2 rows) +(3 rows) SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > int4 '0'; two | f1 -----+------- | 1234 + | 35 | 32767 -(2 rows) +(3 rows) SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= int2 '0'; three | f1 -------+------- | 0 | 1234 + | 35 | 32767 -(3 rows) +(4 rows) SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= int4 '0'; three | f1 -------+------- | 0 | 1234 + | 35 | 32767 -(3 rows) +(4 rows) -- positive odds SELECT '' AS one, i.* FROM INT2_TBL i WHERE (i.f1 % int2 '2') = int2 '1'; one | f1 -----+------- + | 35 | 32767 -(1 row) +(2 rows) -- any evens SELECT '' AS three, i.* FROM INT2_TBL i WHERE (i.f1 % int4 '2') = int2 '0'; @@ -172,7 +176,8 @@ WHERE abs(f1) < 16384; | 0 | 0 | 1234 | 2468 | -1234 | -2468 -(3 rows) + | 35 | 70 +(4 rows) SELECT '' AS five, i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i; five | f1 | x @@ -180,10 +185,11 @@ SELECT '' AS five, i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i; | 0 | 0 | 1234 | 2468 | -1234 | -2468 + | 35 | 70 | 32767 | 65534 | -32767 | -65534 | | -(6 rows) +(7 rows) SELECT '' AS five, i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i; ERROR: smallint out of range @@ -195,8 +201,9 @@ WHERE f1 < 32766; | 0 | 2 | 1234 | 1236 | -1234 | -1232 + | 35 | 37 | -32767 | -32765 -(4 rows) +(5 rows) SELECT '' AS five, i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i; five | f1 | x @@ -204,10 +211,11 @@ SELECT '' AS five, i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i; | 0 | 2 | 1234 | 1236 | -1234 | -1232 + | 35 | 37 | 32767 | 32769 | -32767 | -32765 | | -(6 rows) +(7 rows) SELECT '' AS five, i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i; ERROR: smallint out of range @@ -219,8 +227,9 @@ WHERE f1 > -32767; | 0 | -2 | 1234 | 1232 | -1234 | -1236 + | 35 | 33 | 32767 | 32765 -(4 rows) +(5 rows) SELECT '' AS five, i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i; five | f1 | x @@ -228,10 +237,11 @@ SELECT '' AS five, i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i; | 0 | -2 | 1234 | 1232 | -1234 | -1236 + | 35 | 33 | 32767 | 32765 | -32767 | -32769 | | -(6 rows) +(7 rows) SELECT '' AS five, i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i; five | f1 | x @@ -239,10 +249,11 @@ SELECT '' AS five, i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i; | 0 | 0 | 1234 | 617 | -1234 | -617 + | 35 | 17.5 | 32767 | 16383.5 | -32767 | -16383.5 | | -(6 rows) +(7 rows) SELECT '' AS five, i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i; five | f1 | x @@ -250,10 +261,11 @@ SELECT '' AS five, i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i; | 0 | 0 | 1234 | 617 | -1234 | -617 + | 35 | 17.5 | 32767 | 16383.5 | -32767 | -16383.5 | | -(6 rows) +(7 rows) -- corner cases SELECT (-1::int2<<15)::text; diff --git a/src/test/regress/expected/single_node_int4.out b/src/test/regress/expected/single_node_int4.out index ab2b6730c8bb5121fecc2708a6647983c90dd031..21645195e14cc9627cda0d50ebf76327d251b7a1 100644 --- a/src/test/regress/expected/single_node_int4.out +++ b/src/test/regress/expected/single_node_int4.out @@ -6,10 +6,6 @@ INSERT INTO INT4_TBL(f1) VALUES (' 0 '); INSERT INTO INT4_TBL(f1) VALUES ('123456 '); INSERT INTO INT4_TBL(f1) VALUES (' -123456'); INSERT INTO INT4_TBL(f1) VALUES ('34.5'); -ERROR: invalid input syntax for integer: "34.5" -LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('34.5'); - ^ -CONTEXT: referenced column: f1 -- largest and smallest values INSERT INTO INT4_TBL(f1) VALUES ('2147483647'); INSERT INTO INT4_TBL(f1) VALUES ('-2147483647'); @@ -51,28 +47,31 @@ SELECT '' AS five, * FROM INT4_TBL; | 0 | 123456 | -123456 + | 35 | 2147483647 | -2147483647 | -(6 rows) +(7 rows) SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0'; four | f1 ------+------------- | 123456 | -123456 + | 35 | 2147483647 | -2147483647 -(4 rows) +(5 rows) SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> int4 '0'; four | f1 ------+------------- | 123456 | -123456 + | 35 | 2147483647 | -2147483647 -(4 rows) +(5 rows) SELECT '' AS one, i.* FROM INT4_TBL i WHERE i.f1 = int2 '0'; one | f1 @@ -120,38 +119,43 @@ SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > int2 '0'; two | f1 -----+------------ | 123456 + | 35 | 2147483647 -(2 rows) +(3 rows) SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > int4 '0'; two | f1 -----+------------ | 123456 + | 35 | 2147483647 -(2 rows) +(3 rows) SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= int2 '0'; three | f1 -------+------------ | 0 | 123456 + | 35 | 2147483647 -(3 rows) +(4 rows) SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= int4 '0'; three | f1 -------+------------ | 0 | 123456 + | 35 | 2147483647 -(3 rows) +(4 rows) -- positive odds SELECT '' AS one, i.* FROM INT4_TBL i WHERE (i.f1 % int2 '2') = int2 '1'; one | f1 -----+------------ + | 35 | 2147483647 -(1 row) +(2 rows) -- any evens SELECT '' AS three, i.* FROM INT4_TBL i WHERE (i.f1 % int4 '2') = int2 '0'; @@ -172,7 +176,8 @@ WHERE abs(f1) < 1073741824; | 0 | 0 | 123456 | 246912 | -123456 | -246912 -(3 rows) + | 35 | 70 +(4 rows) SELECT '' AS five, i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i; ERROR: integer out of range @@ -184,7 +189,8 @@ WHERE abs(f1) < 1073741824; | 0 | 0 | 123456 | 246912 | -123456 | -246912 -(3 rows) + | 35 | 70 +(4 rows) SELECT '' AS five, i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i; ERROR: integer out of range @@ -196,8 +202,9 @@ WHERE f1 < 2147483646; | 0 | 2 | 123456 | 123458 | -123456 | -123454 + | 35 | 37 | -2147483647 | -2147483645 -(4 rows) +(5 rows) SELECT '' AS five, i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i; ERROR: integer out of range @@ -209,8 +216,9 @@ WHERE f1 < 2147483646; | 0 | 2 | 123456 | 123458 | -123456 | -123454 + | 35 | 37 | -2147483647 | -2147483645 -(4 rows) +(5 rows) SELECT '' AS five, i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i; ERROR: integer out of range @@ -222,8 +230,9 @@ WHERE f1 > -2147483647; | 0 | -2 | 123456 | 123454 | -123456 | -123458 + | 35 | 33 | 2147483647 | 2147483645 -(4 rows) +(5 rows) SELECT '' AS five, i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i; ERROR: integer out of range @@ -235,8 +244,9 @@ WHERE f1 > -2147483647; | 0 | -2 | 123456 | 123454 | -123456 | -123458 + | 35 | 33 | 2147483647 | 2147483645 -(4 rows) +(5 rows) SELECT '' AS five, i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i; five | f1 | x @@ -244,10 +254,11 @@ SELECT '' AS five, i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i; | 0 | 0 | 123456 | 61728 | -123456 | -61728 + | 35 | 17.5 | 2147483647 | 1073741823.5 | -2147483647 | -1073741823.5 | | -(6 rows) +(7 rows) SELECT '' AS five, i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i; five | f1 | x @@ -255,10 +266,11 @@ SELECT '' AS five, i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i; | 0 | 0 | 123456 | 61728 | -123456 | -61728 + | 35 | 17.5 | 2147483647 | 1073741823.5 | -2147483647 | -1073741823.5 | | -(6 rows) +(7 rows) -- -- more complex expressions diff --git a/src/test/regress/expected/single_node_int8.out b/src/test/regress/expected/single_node_int8.out index b81cc02b9c822949c49114d06bdc5bcfbf8a6b79..10d812073634c7ec95ac4d70505db709f720dde8 100644 --- a/src/test/regress/expected/single_node_int8.out +++ b/src/test/regress/expected/single_node_int8.out @@ -11,12 +11,12 @@ INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789'); INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789'); -- bad inputs INSERT INTO INT8_TBL(q1) VALUES (' '); -ERROR: invalid input syntax for type bigint: " " +ERROR: invalid input syntax for bigint: " " LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' '); ^ CONTEXT: referenced column: q1 INSERT INTO INT8_TBL(q1) VALUES ('xxx'); -ERROR: invalid input syntax for type bigint: "xxx" +ERROR: invalid input syntax for bigint: "xxx" LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('xxx'); ^ CONTEXT: referenced column: q1 @@ -31,12 +31,12 @@ LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('-1204982019841029840928340... ^ CONTEXT: referenced column: q1 INSERT INTO INT8_TBL(q1) VALUES ('- 123'); -ERROR: invalid input syntax for type bigint: "- 123" +ERROR: invalid input syntax for bigint: "- 123" LINE 1: INSERT INTO INT8_TBL(q1) VALUES ('- 123'); ^ CONTEXT: referenced column: q1 INSERT INTO INT8_TBL(q1) VALUES (' 345 5'); -ERROR: invalid input syntax for type bigint: " 345 5" +ERROR: invalid input syntax for bigint: " 345 5" LINE 1: INSERT INTO INT8_TBL(q1) VALUES (' 345 5'); ^ CONTEXT: referenced column: q1 diff --git a/src/test/regress/expected/single_node_numerology.out b/src/test/regress/expected/single_node_numerology.out index 68a58ac223ab73eaba5e8cc9ae9f54ef81803e5d..4723f88c69fbdcf55f00d35c81a99172e54166d2 100644 --- a/src/test/regress/expected/single_node_numerology.out +++ b/src/test/regress/expected/single_node_numerology.out @@ -22,13 +22,15 @@ SELECT '' AS ten, f1 FROM TEMP_FLOAT | -1234 | 0 | 0 + | 35 + | 35 | 1234 | 32767 | 123456 | 2147483647 | | -(12 rows) +(14 rows) -- int4 CREATE TABLE TEMP_INT4 (f1 INT4); @@ -48,10 +50,11 @@ SELECT '' AS nine, f1 FROM TEMP_INT4 | 0 | 0 | 0 + | 35 | 1234 | 32767 | -(10 rows) +(11 rows) -- int2 CREATE TABLE TEMP_INT2 (f1 INT2); @@ -70,7 +73,8 @@ SELECT '' AS five, f1 FROM TEMP_INT2 | 0 | 0 | 0 -(5 rows) + | 35 +(6 rows) -- -- Group-by combinations diff --git a/src/test/regress/expected/single_node_union.out b/src/test/regress/expected/single_node_union.out index 5cd4e6dd898616703c65e09c0f59555c9d59ba74..11012b4346a4d80a4050f6d922ccf38f0e21d9cc 100644 --- a/src/test/regress/expected/single_node_union.out +++ b/src/test/regress/expected/single_node_union.out @@ -170,10 +170,11 @@ ORDER BY 1; -34.84 -1.2345678901234e-200 0 + 35 123456 2147483647 -(10 rows) +(11 rows) SELECT f1 AS ten FROM FLOAT8_TBL UNION ALL @@ -188,10 +189,11 @@ SELECT f1 FROM INT4_TBL; 0 123456 -123456 + 35 2147483647 -2147483647 -(11 rows) +(12 rows) SELECT f1 AS five FROM FLOAT8_TBL WHERE f1 BETWEEN -1e6 AND 1e6 @@ -204,8 +206,9 @@ SELECT f1 FROM INT4_TBL -34.84 -1.2345678901234e-200 0 + 35 123456 -(5 rows) +(6 rows) SELECT CAST(f1 AS char(4)) AS three FROM VARCHAR_TBL UNION @@ -872,11 +875,13 @@ select * from select * from (select * from t3 a union all select * from t3 b) ss join int4_tbl on f1 = expensivefunc(x); - x | f1 ----+---- - 0 | 0 - 0 | 0 -(2 rows) + x | f1 +----+---- + 0 | 0 + 0 | 0 + 35 | 35 + 35 | 35 +(4 rows) drop table t3; drop function expensivefunc(int); diff --git a/src/test/regress/expected/string_digit_to_numeric.out b/src/test/regress/expected/string_digit_to_numeric.out index 6760188d56d96ec8a772d57b7696f94563325948..c5b48970a41f5bc78c58389b5fdfbdda1b2d2599 100644 --- a/src/test/regress/expected/string_digit_to_numeric.out +++ b/src/test/regress/expected/string_digit_to_numeric.out @@ -10,7 +10,10 @@ analyze test1; analyze test2; analyze test3; select * from test1 where c2 > 1; -ERROR: invalid input syntax for type bigint: "1.1" + c1 | c2 +----+---- +(0 rows) + explain (verbose on, costs off) select * from test1 where c2 > 1; QUERY PLAN ------------------------------------------- @@ -38,7 +41,10 @@ explain (verbose on, costs off) select * from test2 join test3 on test2.c1 > tes (7 rows) select * from test2 join test3 on test2.c2 > test3.c2; -ERROR: invalid input syntax for type bigint: "1.1" + c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4 | c5 | c6 | c7 +----+----+----+----+----+----+----+----+----+----+---- +(0 rows) + explain (verbose on, costs off) select * from test2 join test3 on test2.c2 > test3.c2; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ @@ -52,7 +58,10 @@ explain (verbose on, costs off) select * from test2 join test3 on test2.c2 > tes (7 rows) select * from test2 join test3 on test2.c3 > test3.c3; -ERROR: invalid input syntax for integer: "1.01" + c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4 | c5 | c6 | c7 +----+----+----+----+----+----+----+----+----+----+---- +(0 rows) + explain (verbose on, costs off) select * from test2 join test3 on test2.c3 > test3.c3; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ @@ -66,7 +75,10 @@ explain (verbose on, costs off) select * from test2 join test3 on test2.c3 > tes (7 rows) select * from test2 join test3 on test2.c4 > test3.c4; -ERROR: invalid input syntax for type bigint: "1.001" + c1 | c2 | c3 | c4 | c1 | c2 | c3 | c4 | c5 | c6 | c7 +----+----+----+----+----+----+----+----+----+----+---- +(0 rows) + explain (verbose on, costs off) select * from test2 join test3 on test2.c4 > test3.c4; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ @@ -135,7 +147,10 @@ explain (verbose on, costs off) select * from test2 join test3 on test2.c4 > tes create view v1 as select c7 from test2 join test3 on test2.c1 > test3.c1 and test2.c2 > test3.c2 and test2.c3 > test3.c3 and test2.c4 > test3.c4 and test2.c4 > test3.c5 and test2.c4 > test3.c6 and test2.c4 > test3.c7; select * from v1; -ERROR: invalid input syntax for type bigint: "1.1" + c7 +---- +(0 rows) + explain (verbose on, costs off) select * from v1; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -328,7 +343,10 @@ explain (verbose on, costs off) select * from v2; set behavior_compat_options = ''; select * from v1; -ERROR: invalid input syntax for type bigint: "1.1" + c7 +---- +(0 rows) + explain (verbose on, costs off) select * from v1; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -342,7 +360,10 @@ explain (verbose on, costs off) select * from v1; (7 rows) select * from v2; -ERROR: invalid input syntax for type bigint: "1.1" + c7 +---- +(0 rows) + explain (verbose on, costs off) select * from v2; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/test/regress/expected/subselect_part2.out b/src/test/regress/expected/subselect_part2.out index fc6b96054880e55d487d63e2a1aa865bc1805441..a3d7525171bfceb54966095963ab9d2bcb3d52d6 100644 --- a/src/test/regress/expected/subselect_part2.out +++ b/src/test/regress/expected/subselect_part2.out @@ -119,10 +119,11 @@ select q from (select max(f1) from int4_tbl group by f1 order by f1) q; (-2147483647) (-123456) (0) + (35) (123456) (2147483647) () -(6 rows) +(7 rows) with q as (select max(f1) from int4_tbl group by f1 order by f1) select q from q; @@ -131,10 +132,11 @@ with q as (select max(f1) from int4_tbl group by f1 order by f1) (-2147483647) (-123456) (0) + (35) (123456) (2147483647) () -(6 rows) +(7 rows) -- -- check for over-optimization of whole-row Var referencing an Append plan @@ -146,9 +148,10 @@ select (select q from (select 1,2,3 where f1 > 0 union all select 4,5,6.0 where (1,2,3) (4,5,6.0) (1,2,3) + (1,2,3) (4,5,6.0) -(6 rows) +(7 rows) -- -- Test case for sublinks pushed down into subselects via join alias expansion