diff options
author | unknown <anozdrin/alik@station.> | 2007-10-20 21:48:15 +0400 |
---|---|---|
committer | unknown <anozdrin/alik@station.> | 2007-10-20 21:48:15 +0400 |
commit | d1ddc24a1ae8bff060ac721f94c6948010a04642 (patch) | |
tree | 0618e0e21b4d2baf858b1032b77241f6632acdec /mysql-test/t/key.test | |
parent | c33823ba83639465595cce44754dcdfad66aecfd (diff) | |
download | mariadb-git-d1ddc24a1ae8bff060ac721f94c6948010a04642.tar.gz |
Fix for BUG#31148: bool close_thread_table(THD*, TABLE**):
Assertion `table->key_read == 0' failed.
The problem was that key_read on a table in a sub-select was not
properly reset. That happens because the code responsible for that
is copy&pasted all around the server. In some place, it was obviously
forgotten to be pasted.
The fix is to reset key_read properly.
mysql-test/r/key.result:
Update result file.
mysql-test/t/key.test:
A test case for BUG#31148: bool close_thread_table(THD*, TABLE**):
Assertion `table->key_read == 0' failed.
sql/sql_select.cc:
Reset key_read before closing index.
Diffstat (limited to 'mysql-test/t/key.test')
-rw-r--r-- | mysql-test/t/key.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index f1eb8e68b49..cd6c480407d 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -501,3 +501,26 @@ ORDER BY c.b, c.d ; DROP TABLE t1, t2; + +# +# Bug #31148: bool close_thread_table(THD*, TABLE**): Assertion +# `table->key_read == 0' failed. +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT); + +INSERT INTO t1 VALUES (), (), (); + +SELECT 1 AS c1 +FROM t1 +ORDER BY ( + SELECT 1 AS c2 + FROM t1 + GROUP BY GREATEST(LAST_INSERT_ID(), t1.a) ASC + LIMIT 1); + +DROP TABLE t1; |