diff options
author | unknown <gshchepa/uchum@host.loc> | 2008-02-28 22:53:31 +0400 |
---|---|---|
committer | unknown <gshchepa/uchum@host.loc> | 2008-02-28 22:53:31 +0400 |
commit | d40ca16156641481abd45f93e31233044f4b9df6 (patch) | |
tree | 4723f5103cd22297847499b00e04562fb95a6063 /mysql-test/t/row.test | |
parent | c4fc5b096e582f23bac8bc14cb93f6ade63f476f (diff) | |
download | mariadb-git-d40ca16156641481abd45f93e31233044f4b9df6.tar.gz |
Fixed bug #34620: item_row.cc:50: Item_row::illegal_method_call(const char*):
Assertion `0' failed
If ROW item is a part of an expression that also has
aggregate function calls (COUNT/SUM/AVG...), a
"splitting" with an Item::split_sum_func2 function
is applied to that ROW item.
Current implementation of Item::split_sum_func2
replaces this Item_row with a newly created
Item_aggregate_ref reference to it.
Then the row cache tries to work with the
Item_aggregate_ref object as with the Item_row object:
row cache calls row-emulation methods such as cols and
element_index. Item_aggregate_ref (like it's parent
Item_ref) inherits dummy implementations of those
methods from the hierarchy root Item, and call to
them leads to failed assertions and wrong data
output.
Row-emulation virtual functions (cols, element_index, addr,
check_cols, null_inside and bring_value) of Item_ref have
been overloaded to forward calls to an underlying item
reference.
mysql-test/r/row.result:
Added test case for bug #34620.
mysql-test/t/row.test:
Added test case for bug #34620.
sql/item.h:
Fixed bug #34620.
Row-emulation virtual functions (cols, element_index, addr,
check_cols, null_inside and bring_value) of Item_ref have
been overloaded to forward calls to an underlying item
reference.
Diffstat (limited to 'mysql-test/t/row.test')
-rw-r--r-- | mysql-test/t/row.test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index 20d044306a6..1601f7afd0e 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -224,3 +224,16 @@ SET @x:= (SELECT h FROM t1 WHERE (a,b,c,d,e,f,g)=(1,2,3,4,5,6,7)); SELECT @x; DROP TABLE t1; + +# +# Bug #34620: item_row.cc:50: Item_row::illegal_method_call(const char*): +# Assertion `0' failed +# + +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1,1); + +SELECT ROW(a, 1) IN (SELECT SUM(b), 1) FROM t1 GROUP BY a; +SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a; + +DROP TABLE t1; |