#At file:///home/og136792/mysql/mysql-5.5-bugteam/ based on revid:davi.arnaut@stripped
3258 Oystein Grovlen 2010-10-26
Bug#57704 Cleanup code dies with void TABLE::set_keyread(bool): Assertion `file' failed.
This bug was introduced in this revision:
kostja@stripped
("A pre-requisite patch for the fix for Bug#52044.")
It happens because close_thread_tables() is now called in
open_and_lock_tables upon failure. Hence, table is no longer
open when optimizer tries to do cleanup.
Fix: Skip cleanup of table, if table->file is not set.
@ mysql-test/r/subselect.result
Added test case for Bug#57704.
@ mysql-test/t/subselect.test
Added test case for Bug#57704.
@ sql/sql_select.cc
If table->file is not set, no need to do cleanup since table
has been closed. This happens if query fails in open_and_lock_tables().
modified:
mysql-test/r/subselect.result
mysql-test/t/subselect.test
sql/sql_select.cc
=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result 2010-09-09 15:00:33 +0000
+++ b/mysql-test/r/subselect.result 2010-10-26 12:01:39 +0000
@@ -5005,3 +5005,15 @@ SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
DROP TABLE t1,t2;
End of 5.1 tests
+#
+# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
+# Assertion `file' failed.
+#
+CREATE TABLE t1 (a INT);
+SELECT 1 FROM
+(SELECT ROW(
+(SELECT 1 FROM t1 RIGHT JOIN
+(SELECT 1 FROM t1, t1 t2) AS d ON 1),
+1) FROM t1) AS e;
+ERROR 21000: Operand should contain 1 column(s)
+DROP TABLE t1;
=== modified file 'mysql-test/t/subselect.test'
--- a/mysql-test/t/subselect.test 2010-06-25 13:32:47 +0000
+++ b/mysql-test/t/subselect.test 2010-10-26 12:01:39 +0000
@@ -3946,3 +3946,21 @@ DROP TABLE t1,t2;
--enable_result_log
--echo End of 5.1 tests
+
+--echo #
+--echo # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
+--echo # Assertion `file' failed.
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+--error 1241
+SELECT 1 FROM
+ (SELECT ROW(
+ (SELECT 1 FROM t1 RIGHT JOIN
+ (SELECT 1 FROM t1, t1 t2) AS d ON 1),
+ 1) FROM t1) AS e;
+
+DROP TABLE t1;
+
+
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2010-10-05 11:33:54 +0000
+++ b/sql/sql_select.cc 2010-10-26 12:01:39 +0000
@@ -6955,7 +6955,7 @@ void JOIN_TAB::cleanup()
my_free(cache.buff);
cache.buff= 0;
limit= 0;
- if (table)
+ if (table && table->file)
{
table->set_keyread(FALSE);
table->file->ha_index_or_rnd_end();
Attachment: [text/bzr-bundle] bzr/oystein.grovlen@oracle.com-20101026120139-rbtco198tpglgzty.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-bugteam branch (oystein.grovlen:3258) Bug#57704 | Oystein Grovlen | 26 Oct |