Below is the list of changes that have just been committed into a local
5.1 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-11-05 13:19:56+02:00, gkodinov@stripped +3 -0
Bug #31974: Wrong EXPLAIN output
The fix for bug 31148 is not correct. It does not
have a relation to the problem described in this bug.
And removing the fix will not make the bug to re-appear.
Fixed the bug #31974 by removing the fix for bug 31148
and adding a test case.
mysql-test/r/key.result@stripped, 2007-11-05 13:19:54+02:00, gkodinov@stripped +14 -0
Bug #31974: test case
mysql-test/t/key.test@stripped, 2007-11-05 13:19:54+02:00, gkodinov@stripped +17 -0
Bug #31974: test case
sql/sql_select.cc@stripped, 2007-11-05 13:19:54+02:00, gkodinov@stripped +0 -7
Bug #31974: revert the fix for bug 31148
diff -Nrup a/mysql-test/r/key.result b/mysql-test/r/key.result
--- a/mysql-test/r/key.result 2007-10-20 20:48:13 +03:00
+++ b/mysql-test/r/key.result 2007-11-05 13:19:54 +02:00
@@ -545,3 +545,17 @@ c1
1
1
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, INDEX (a,b));
+INSERT INTO t1 (a, b)
+VALUES
+(1,1), (1,2), (1,3), (1,4), (1,5),
+(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
+EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
+(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
+SELECT 1 as RES FROM t1 AS t1_outer WHERE
+(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
+RES
+DROP TABLE t1;
diff -Nrup a/mysql-test/t/key.test b/mysql-test/t/key.test
--- a/mysql-test/t/key.test 2007-10-20 20:48:13 +03:00
+++ b/mysql-test/t/key.test 2007-11-05 13:19:54 +02:00
@@ -524,3 +524,20 @@ ORDER BY (
LIMIT 1);
DROP TABLE t1;
+
+
+#
+# Bug #31974: Wrong EXPLAIN output
+#
+
+CREATE TABLE t1 (a INT, b INT, INDEX (a,b));
+INSERT INTO t1 (a, b)
+ VALUES
+ (1,1), (1,2), (1,3), (1,4), (1,5),
+ (2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
+EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
+ (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
+SELECT 1 as RES FROM t1 AS t1_outer WHERE
+ (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
+
+DROP TABLE t1;
diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc
--- a/sql/sql_select.cc 2007-11-01 16:07:59 +02:00
+++ b/sql/sql_select.cc 2007-11-05 13:19:54 +02:00
@@ -6651,14 +6651,7 @@ void JOIN::cleanup(bool full)
for (tab= join_tab, end= tab+tables; tab != end; tab++)
{
if (tab->table)
- {
- if (tab->table->key_read)
- {
- tab->table->key_read= 0;
- tab->table->file->extra(HA_EXTRA_NO_KEYREAD);
- }
tab->table->file->ha_index_or_rnd_end();
- }
}
}
}
| Thread |
|---|
| • bk commit into 5.1 tree (gkodinov:1.2607) BUG#31974 | kgeorge | 5 Nov |