mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for bug#49570: Assertion failed: !(order->used & map)
on re-execution of prepared statement Problem: some (see eq_ref_table()) ORDER BY/GROUP BY optimization is called before each PS execution. However, we don't properly initialize its stucture every time before the call. Fix: properly initialize the sturture used. mysql-test/r/ps.result: Fix for bug#49570: Assertion failed: !(order->used & map) on re-execution of prepared statement - test result. mysql-test/t/ps.test: Fix for bug#49570: Assertion failed: !(order->used & map) on re-execution of prepared statement - test case. sql/sql_select.cc: Fix for bug#49570: Assertion failed: !(order->used & map) on re-execution of prepared statement - set order->used to 0 before each eq_ref_table() call, as the function relies on that.
This commit is contained in:
@ -1916,4 +1916,26 @@ execute stmt;
|
||||
deallocate prepare stmt;
|
||||
drop table t1,t2;
|
||||
#
|
||||
#
|
||||
# Bug #49570: Assertion failed: !(order->used & map)
|
||||
# on re-execution of prepared statement
|
||||
#
|
||||
CREATE TABLE t1(a INT PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES(0), (1);
|
||||
PREPARE stmt FROM
|
||||
"SELECT 1 FROM t1 JOIN t1 t2 USING(a) GROUP BY t2.a, t1.a";
|
||||
EXECUTE stmt;
|
||||
1
|
||||
1
|
||||
1
|
||||
EXECUTE stmt;
|
||||
1
|
||||
1
|
||||
1
|
||||
EXECUTE stmt;
|
||||
1
|
||||
1
|
||||
1
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
|
Reference in New Issue
Block a user