Commit 9b53d84d authored by Alexander Barkov's avatar Alexander Barkov

MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field().

Removing a wrong ASSERT. Item_sum_field now uses the inherited
Item::get_tmp_table_field().
parent d5d0c35f
...@@ -2298,6 +2298,15 @@ id avg cast_avg ...@@ -2298,6 +2298,15 @@ id avg cast_avg
2 9223372036854775807.0000 9223372036854775807 2 9223372036854775807.0000 9223372036854775807
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field()
#
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT DISTINCT VAR_POP(1) FROM t1 GROUP BY @a := 's';
VAR_POP(1)
0.0000
DROP TABLE t1;
#
# MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED) # MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED)
# #
CREATE TABLE t1 (id INT, a DOUBLE); CREATE TABLE t1 (id INT, a DOUBLE);
......
...@@ -1581,6 +1581,14 @@ SELECT id, AVG(a) AS avg, CAST(MIN(a) AS SIGNED) AS cast_min FROM t1 GROUP BY id ...@@ -1581,6 +1581,14 @@ SELECT id, AVG(a) AS avg, CAST(MIN(a) AS SIGNED) AS cast_min FROM t1 GROUP BY id
SELECT id, AVG(a) AS avg, CAST(AVG(a) AS SIGNED) AS cast_avg FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id; SELECT id, AVG(a) AS avg, CAST(AVG(a) AS SIGNED) AS cast_avg FROM t1 GROUP BY id HAVING avg!=123 ORDER BY id;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field()
--echo #
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT DISTINCT VAR_POP(1) FROM t1 GROUP BY @a := 's';
DROP TABLE t1;
--echo # --echo #
--echo # MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED) --echo # MDEV-8921 Wrong result for CAST(AVG(double_column) AS SIGNED)
--echo # --echo #
......
...@@ -1084,7 +1084,6 @@ public: ...@@ -1084,7 +1084,6 @@ public:
fixed= true; fixed= true;
} }
table_map used_tables() const { return (table_map) 1L; } table_map used_tables() const { return (table_map) 1L; }
Field *get_tmp_table_field() { DBUG_ASSERT(0); return NULL; }
Field *tmp_table_field(TABLE *) { DBUG_ASSERT(0); return NULL; } Field *tmp_table_field(TABLE *) { DBUG_ASSERT(0); return NULL; }
void set_result_field(Field *) { DBUG_ASSERT(0); } void set_result_field(Field *) { DBUG_ASSERT(0); }
void save_in_result_field(bool no_conversions) { DBUG_ASSERT(0); } void save_in_result_field(bool no_conversions) { DBUG_ASSERT(0); }
......
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