Commit 9bf50a0e authored by Dmitry Shulga's avatar Dmitry Shulga

MDEV-32965: Assertion `thd->active_stmt_arena_to_use()->...

MDEV-32965:  Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_sp_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed

This patch fixes too strong condition in assert at the method
  Item_func_group_concat::fix_fields
that is true in case of a stored routine and obviously broken
for a prepared statement.
parent 5775df01
......@@ -5805,5 +5805,15 @@ END;
$
ERROR 42000: EXECUTE..USING does not support subqueries or stored functions
#
# MDEV-32965: Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_sp_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed
#
CREATE TABLE t (f VARCHAR(8)) CHARACTER SET utf8;
INSERT INTO t VALUES ('foo'),('bar');
EXECUTE IMMEDIATE 'SELECT GROUP_CONCAT(@x) FROM t GROUP BY @x := f';
GROUP_CONCAT(@x)
0
0
DROP TABLE t;
#
# End of 10.4 tests
#
......@@ -5231,6 +5231,18 @@ $
delimiter ;$
--echo #
--echo # MDEV-32965: Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_sp_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed
--echo #
CREATE TABLE t (f VARCHAR(8)) CHARACTER SET utf8;
INSERT INTO t VALUES ('foo'),('bar');
EXECUTE IMMEDIATE 'SELECT GROUP_CONCAT(@x) FROM t GROUP BY @x := f';
# Cleanup
DROP TABLE t;
--echo #
--echo # End of 10.4 tests
--echo #
......@@ -4099,7 +4099,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
String *new_separator;
DBUG_ASSERT(thd->active_stmt_arena_to_use()->
is_stmt_prepare_or_first_sp_execute() ||
is_stmt_prepare_or_first_stmt_execute() ||
thd->active_stmt_arena_to_use()->
is_conventional() ||
thd->active_stmt_arena_to_use()->state ==
......
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