2718 Sergey Petrunia 2008-12-22 [merge]
Merge
added:
mysql-test/r/ctype_filesystem.result
mysql-test/r/multi_update2.result
mysql-test/r/perror-win.result
mysql-test/t/ctype_filesystem-master.opt
mysql-test/t/ctype_filesystem.test
mysql-test/t/multi_update2-master.opt
mysql-test/t/multi_update2.test
mysql-test/t/perror-win.test
modified:
client/mysql.cc
configure.in
extra/perror.c
include/config-win.h
include/my_global.h
innobase/btr/btr0cur.c
innobase/btr/btr0sea.c
innobase/dict/dict0dict.c
innobase/include/btr0sea.h
innobase/include/ut0ut.h
innobase/srv/srv0srv.c
innobase/srv/srv0start.c
innobase/ut/ut0ut.c
myisam/ft_boolean_search.c
mysql-test/include/check-testcase.test
mysql-test/mysql-test-run.pl
mysql-test/r/alter_table.result
mysql-test/r/binlog_index.result
mysql-test/r/csv.result
mysql-test/r/ctype_utf8.result
mysql-test/r/explain.result
mysql-test/r/fulltext.result
mysql-test/r/func_group.result
mysql-test/r/func_if.result
mysql-test/r/func_sapdb.result
mysql-test/r/func_str.result
mysql-test/r/innodb_mysql.result
mysql-test/r/multi_update.result
mysql-test/r/mysql.result
mysql-test/r/rpl_packet.result
mysql-test/r/subselect.result
mysql-test/r/timezone2.result
mysql-test/r/timezone3.result
mysql-test/r/type_bit.result
mysql-test/r/type_float.result
mysql-test/r/type_newdecimal.result
mysql-test/r/view.result
mysql-test/std_data/Moscow_leap
mysql-test/t/alter_table.test
mysql-test/t/csv.test
mysql-test/t/ctype_utf8.test
mysql-test/t/explain.test
mysql-test/t/fulltext.test
mysql-test/t/func_group.test
mysql-test/t/func_if.test
mysql-test/t/func_sapdb.test
mysql-test/t/func_str.test
mysql-test/t/innodb_mysql.test
mysql-test/t/multi_update.test
mysql-test/t/mysql.test
mysql-test/t/rpl_packet.test
mysql-test/t/subselect.test
mysql-test/t/timezone3.test
mysql-test/t/type_bit.test
mysql-test/t/type_float.test
mysql-test/t/type_newdecimal.test
mysql-test/t/view.test
sql/examples/ha_tina.cc
sql/field.cc
sql/ha_federated.cc
sql/ha_innodb.cc
sql/handler.cc
sql/handler.h
sql/item.cc
sql/item_cmpfunc.cc
sql/item_cmpfunc.h
sql/item_func.cc
sql/item_func.h
sql/item_strfunc.h
sql/item_sum.cc
sql/item_sum.h
sql/item_timefunc.cc
sql/item_timefunc.h
sql/log.cc
sql/my_decimal.cc
sql/mysql_priv.h
sql/mysqld.cc
sql/nt_servc.cc
sql/nt_servc.h
sql/opt_range.cc
sql/opt_sum.cc
sql/set_var.cc
sql/set_var.h
sql/sql_base.cc
sql/sql_class.h
sql/sql_cursor.cc
sql/sql_select.cc
sql/sql_show.cc
sql/sql_table.cc
sql/sql_update.cc
sql/sql_view.cc
sql/tztime.cc
sql/tztime.h
tests/mysql_client_test.c
=== modified file 'mysql-test/r/index_merge.result'
--- a/mysql-test/r/index_merge.result 2008-10-01 15:50:55 +0000
+++ b/mysql-test/r/index_merge.result 2008-12-19 13:38:39 +0000
@@ -527,4 +527,32 @@ b a
y
z
DROP TABLE t1;
+#
+# BUG#40974: Incorrect query results when using clause evaluated using range check
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2(a int, b int);
+insert into t2 values (1,1), (2, 1000);
+create table t3 (a int, b int, filler char(100), key(a), key(b));
+insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
+insert into t3 values (1,1,'data');
+insert into t3 values (1,1,'data');
+The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
+explain select * from t1
+where exists (select 1 from t2, t3
+where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t3 ALL a,b NULL NULL NULL 1002 Range checked for each record (index map: 0x3)
+select * from t1
+where exists (select 1 from t2, t3
+where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+a
+1
+2
+drop table t0, t1, t2, t3;
End of 5.0 tests
=== modified file 'mysql-test/t/index_merge.test'
--- a/mysql-test/t/index_merge.test 2008-10-01 15:50:55 +0000
+++ b/mysql-test/t/index_merge.test 2008-12-19 13:38:39 +0000
@@ -477,4 +477,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!=
DROP TABLE t1;
+--echo #
+--echo # BUG#40974: Incorrect query results when using clause evaluated using range check
+--echo #
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+create table t2(a int, b int);
+insert into t2 values (1,1), (2, 1000);
+create table t3 (a int, b int, filler char(100), key(a), key(b));
+
+insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
+insert into t3 values (1,1,'data');
+insert into t3 values (1,1,'data');
+-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
+explain select * from t1
+where exists (select 1 from t2, t3
+ where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+
+select * from t1
+where exists (select 1 from t2, t3
+ where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
+
+drop table t0, t1, t2, t3;
+
--echo End of 5.0 tests
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc 2008-12-09 18:35:02 +0000
+++ b/sql/opt_range.cc 2008-12-22 20:28:08 +0000
@@ -1109,6 +1109,9 @@ QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_M
quick->file= NULL;
quick_selects.delete_elements();
delete pk_quick_select;
+ /* It's ok to call the next two even if they are already deinitialized */
+ end_read_record(&read_record);
+ free_io_cache(head);
free_root(&alloc,MYF(0));
DBUG_VOID_RETURN;
}
| Thread |
|---|
| • bzr push into mysql-5.0-bugteam branch (sergefp:2718) | Sergey Petrunia | 22 Dec |