Commit 528df1df authored by unknown's avatar unknown

MDEV-5505: Assertion `! is_set()' fails on PREPARE SELECT with out of range in GROUP BY

Fixed error processing in find_order_in_list(): if an error reported to user there is no sens to continue.
parent 55829ac1
......@@ -4041,3 +4041,14 @@ DEALLOCATE PREPARE stmt;
DROP VIEW v2;
DROP TABLE t1, t2;
# End of 5.3 tests
#
# MDEV-5505: Assertion `! is_set()' fails on PREPARE SELECT
# with out of range in GROUP BY
#
CREATE TABLE t1 (a INT);
PREPARE stmt FROM "SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1";
ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)'
SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)'
drop table t1;
# End of 5.3 tests
......@@ -3618,3 +3618,18 @@ DROP VIEW v2;
DROP TABLE t1, t2;
--echo # End of 5.3 tests
--echo #
--echo # MDEV-5505: Assertion `! is_set()' fails on PREPARE SELECT
--echo # with out of range in GROUP BY
--echo #
CREATE TABLE t1 (a INT);
--error ER_DATA_OUT_OF_RANGE
PREPARE stmt FROM "SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1";
--error ER_DATA_OUT_OF_RANGE
SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1;
drop table t1;
--echo # End of 5.3 tests
......@@ -20435,7 +20435,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
if (!order_item->fixed &&
(order_item->fix_fields(thd, order->item) ||
(order_item= *order->item)->check_cols(1) ||
thd->is_fatal_error))
thd->is_error()))
return TRUE; /* Wrong field. */
uint el= all_fields.elements;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment