diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-12-26 14:59:56 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-12-26 14:59:56 +0400 |
commit | 732a6a9e36e54e53299ac6d4d53897e9223f4805 (patch) | |
tree | 38b8c71572e79a92c66391222d082edcf033aab1 | |
parent | 416df0eaada5b644931f5b3b15f897a376641a4d (diff) | |
parent | 7344b58c32c07df496c208dad5c1e11c304e8aac (diff) | |
download | mariadb-git-732a6a9e36e54e53299ac6d4d53897e9223f4805.tar.gz |
Auto-merge.
-rw-r--r-- | mysql-test/r/ps.result | 22 | ||||
-rw-r--r-- | mysql-test/t/ps.test | 16 | ||||
-rw-r--r-- | sql/sql_select.cc | 1 |
3 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 8a19b9b17e1..6e017ec7253 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -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. diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 8f8e943913f..e207b0f154a 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1996,4 +1996,20 @@ deallocate prepare stmt; drop table t1,t2; --echo # + +--echo # +--echo # Bug #49570: Assertion failed: !(order->used & map) +--echo # on re-execution of prepared statement +--echo # +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; +EXECUTE stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; + + --echo End of 5.0 tests. diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d22a23a10d4..d8ec5eff5c1 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6777,6 +6777,7 @@ static void update_depend_map(JOIN *join, ORDER *order) table_map depend_map; order->item[0]->update_used_tables(); order->depend_map=depend_map=order->item[0]->used_tables(); + order->used= 0; // Not item_sum(), RAND() and no reference to table outside of sub select if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT)) && !order->item[0]->with_sum_func) |