List:Commits« Previous MessageNext Message »
From:Evgeny Potemkin Date:August 23 2011 5:55am
Subject:bzr push into mysql-trunk branch (evgeny.potemkin:3396) Bug#12896124
View as plain text  
 3396 Evgeny Potemkin	2011-08-23 [merge]
      Auto-merged fix for the bug#12896124.

    added:
      mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
      mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
      storage/innobase/buf/buf0checksum.c
      storage/innobase/include/buf0checksum.h
      storage/innobase/include/ut0crc32.h
      storage/innobase/ut/ut0crc32.c
    modified:
      extra/CMakeLists.txt
      extra/innochecksum.c
      mysql-test/collections/default.experimental
      mysql-test/suite/rpl/r/rpl_mixed_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_mixed_mts_rec_crash_safe.result
      mysql-test/suite/rpl/r/rpl_mixed_mts_rec_crash_safe_checksum.result
      mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_row_mts_rec_crash_safe.result
      mysql-test/suite/rpl/r/rpl_stm_mts_crash_safe.result
      mysql-test/suite/rpl/r/rpl_stm_mts_rec_crash_safe.result
      mysql-test/suite/sys_vars/t/disabled.def
      sql/CMakeLists.txt
      sql/log_event.cc
      sql/sql_class.cc
      storage/innobase/CMakeLists.txt
      storage/innobase/buf/buf0buf.c
      storage/innobase/buf/buf0flu.c
      storage/innobase/buf/buf0lru.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/buf0buf.h
      storage/innobase/include/page0zip.h
      storage/innobase/include/srv0srv.h
      storage/innobase/include/univ.i
      storage/innobase/page/page0zip.c
      storage/innobase/srv/srv0srv.c
=== modified file 'mysql-test/r/derived.result'
--- a/mysql-test/r/derived.result	2011-08-19 11:39:15 +0000
+++ b/mysql-test/r/derived.result	2011-08-23 05:45:43 +0000
@@ -1530,3 +1530,34 @@ Handler_write	1021
 set @@max_heap_table_size= @save_heap_size;
 drop table t1;
 #
+#
+# Bug#12896124: Crash on rqg_mdl_stability test
+#
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE FUNCTION func1 (param1 INTEGER) RETURNS INT NOT DETERMINISTIC
+return param1;
+CREATE FUNCTION func2 (param1 INTEGER) RETURNS INT 
+return param1;
+SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func1(f1);
+f1
+1
+2
+3
+EXPLAIN SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func1(f1);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	ALL	NULL	NULL	NULL	NULL	3	Using where
+2	DERIVED	t1	ALL	NULL	NULL	NULL	NULL	3	
+SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func2(f1);
+f1
+1
+2
+3
+EXPLAIN SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func2(f1);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	ALL	NULL	NULL	NULL	NULL	3	Using where
+2	DERIVED	t1	ALL	NULL	NULL	NULL	NULL	3	
+DROP FUNCTION func1;
+DROP FUNCTION func2;
+DROP TABLE t1;
+#

=== modified file 'mysql-test/t/derived.test'
--- a/mysql-test/t/derived.test	2011-07-28 12:53:50 +0000
+++ b/mysql-test/t/derived.test	2011-08-23 05:45:43 +0000
@@ -905,3 +905,21 @@ drop table t1;
 
 --echo #
 
+--echo #
+--echo # Bug#12896124: Crash on rqg_mdl_stability test
+--echo #
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE FUNCTION func1 (param1 INTEGER) RETURNS INT NOT DETERMINISTIC
+return param1;
+CREATE FUNCTION func2 (param1 INTEGER) RETURNS INT 
+return param1;
+SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func1(f1);
+EXPLAIN SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func1(f1);
+SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func2(f1);
+EXPLAIN SELECT * FROM (SELECT * FROM t1) tt WHERE f1 = func2(f1);
+DROP FUNCTION func1;
+DROP FUNCTION func2;
+DROP TABLE t1;
+--echo #
+

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2011-08-19 13:04:28 +0000
+++ b/sql/table.cc	2011-08-23 05:45:43 +0000
@@ -5846,8 +5846,8 @@ bool TABLE_LIST::update_derived_keys(Fie
 
   for (uint i= 0; i < num_values; i++)
   {
-    table_map tables= values[i]->used_tables();
-    if (!tables)
+    table_map tables= values[i]->used_tables() & ~PSEUDO_TABLE_BITS;
+    if (!tables || values[i]->real_item()->type() != Item::FIELD_ITEM)
       continue;
     for (table_map tbl= 1; tables >= tbl; tbl<<= 1)
     {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (evgeny.potemkin:3396) Bug#12896124Evgeny Potemkin24 Aug