From: Date: May 23 2008 12:42am Subject: bzr commit into MySQL:mysql-6.0 tree (konstantin:2642) Bug#27430 List-Archive: http://lists.mysql.com/commits/46978 X-Bug: 27430 Message-Id: <20080522224247.7FEF733006@vajra.local> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0886081596==" --===============0886081596== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///opt/local/work/mysql-6.0-runtime/ ------------------------------------------------------------ revno: 2642 revision-id: konstantin@stripped parent: konstantin@stripped committer: Konstantin Osipov branch nick: mysql-6.0-runtime timestamp: Fri 2008-05-23 02:42:32 +0400 message: Bug#27430 "Crash in subquery code when in PS and table DDL changed after PREPARE" Add a test case for the situation with small TDC and many merge children. modified: mysql-test/r/merge.result sp1f-merge.result-20001228015634-pf2nbswryog4ykgcx7icbva7tgga7ppt mysql-test/t/merge.test sp1f-merge.test-20001228015636-6f5h74kivnnxupyw56zl2jueijh5rb3x per-file comments: mysql-test/r/merge.result Update results (Bug#27430) mysql-test/t/merge.test Add test case (Bug#27430) --===============0886081596== MIME-Version: 1.0 Content-Type: text/text/x-diff; charset="us-ascii"; name="patch-2642.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline === modified file 'mysql-test/r/merge.result' --- a/mysql-test/r/merge.result 2008-05-01 09:34:54 +0000 +++ b/mysql-test/r/merge.result 2008-05-22 22:42:32 +0000 @@ -2022,3 +2022,39 @@ 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away DROP TABLE t1, t2, t3, t4; End of 5.1 tests +# +# An additional test case for Bug#27430 Crash in subquery code +# when in PS and table DDL changed after PREPARE +# +# Test merge table with too many merge children. +# +drop table if exists t_parent; +set @save_table_definition_cache=@@global.table_definition_cache; +# +# Set @@global.table_definition_cache to minimum +# +set @@global.table_definition_cache=256; +set @a=null; +# +# Create 256 merge children +# +set @a=concat("create table t_parent (a int) union(", @a, +") insert_method=first engine=mrg_myisam"); +prepare stmt from @a; +execute stmt; +prepare stmt from "select * from t_parent"; +execute stmt; +ERROR HY000: Prepared statement needs to be re-prepared +execute stmt; +ERROR HY000: Prepared statement needs to be re-prepared +execute stmt; +ERROR HY000: Prepared statement needs to be re-prepared +deallocate prepare stmt; +# +# Create merge parent +# +# +# Cleanup +# +drop table t_parent; +set @@global.table_definition_cache=@save_table_definition_cache; === modified file 'mysql-test/t/merge.test' --- a/mysql-test/t/merge.test 2008-05-01 09:34:54 +0000 +++ b/mysql-test/t/merge.test 2008-05-22 22:42:32 +0000 @@ -1410,3 +1410,64 @@ DROP TABLE t1, t2, t3, t4; --echo End of 5.1 tests + + +--echo # +--echo # An additional test case for Bug#27430 Crash in subquery code +--echo # when in PS and table DDL changed after PREPARE +--echo # +--echo # Test merge table with too many merge children. +--echo # +--disable_warnings +drop table if exists t_parent; +--enable_warnings +set @save_table_definition_cache=@@global.table_definition_cache; +--echo # +--echo # Set @@global.table_definition_cache to minimum +--echo # +set @@global.table_definition_cache=256; +set @a=null; +let $1 = 256; +--echo # +--echo # Create 256 merge children +--echo # +--disable_query_log +while ($1) +{ +--disable_warnings + eval drop table if exists t$1; +--enable_warnings + eval create table t$1 (a int) engine=myisam; + eval set @a=ifnull(concat(@a, ", ", "t$1"), "t$1"); + dec $1; +} +--enable_query_log +set @a=concat("create table t_parent (a int) union(", @a, + ") insert_method=first engine=mrg_myisam"); +prepare stmt from @a; +execute stmt; +prepare stmt from "select * from t_parent"; +--error ER_NEED_REPREPARE +execute stmt; +--error ER_NEED_REPREPARE +execute stmt; +--error ER_NEED_REPREPARE +execute stmt; +deallocate prepare stmt; +--echo # +--echo # Create merge parent +--echo # + +--echo # +--echo # Cleanup +--echo # +let $1 = 256; +--disable_query_log +while ($1) +{ + eval drop table t$1; + dec $1; +} +--enable_query_log +drop table t_parent; +set @@global.table_definition_cache=@save_table_definition_cache; --===============0886081596==--