From: Matthias Leich Date: August 13 2008 7:42pm Subject: bzr commit into mysql-5.1-bugteam tree (mleich:2696) Bug#12093 List-Archive: http://lists.mysql.com/commits/51561 X-Bug: 12093 Message-Id: <20080813194234.6D7D7A528F@five.local.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8045762775640490392==" --===============8045762775640490392== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///work2/5.1/mysql-5.1-bugteam-push/ ------------------------------------------------------------ revno: 2696 revision-id: mleich@stripped parent: mattiasj@stripped committer: Matthias Leich branch nick: mysql-5.1-bugteam-push timestamp: Mi 2008-08-13 21:42:21 +0200 message: Improve the testcases for Bug 12093 in ps_ddl.test Details: - add subtest with drop unrelated view - rearrange existing tests so that a distinction between drop procedure and drop function effects is possible added: mysql-test/include/ps_ddl_1.inc ps_ddl_1.inc-20080813193914-5m34walobgzv0okx-1 modified: mysql-test/r/ps_ddl.result sp1f-ps_ddl.result-20071215004622-7wxecn5bjzrz7scbog54tuaaobpayisn mysql-test/t/ps_ddl.test sp1f-ps_ddl.test-20071215004622-2fkvss6xi7zvoksbhhmbwak3gs54jnbo --===============8045762775640490392== MIME-Version: 1.0 Content-Type: text/text/x-diff; charset="us-ascii"; name="patch-2696.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline === added file 'mysql-test/include/ps_ddl_1.inc' --- a/mysql-test/include/ps_ddl_1.inc 1970-01-01 00:00:00 +0000 +++ b/mysql-test/include/ps_ddl_1.inc 2008-08-13 19:42:21 +0000 @@ -0,0 +1,25 @@ +# include/ps_ddl_1.inc +# +# Auxiliary script to be used in ps_ddl.test +# + +prepare stmt_sf from 'select f_12093();'; +prepare stmt_sp from 'call p_12093(f_12093())'; +execute stmt_sf; +execute stmt_sp; + +connection con1; +eval $my_drop; +# +connection default; +--echo # XXX: used to be a bug +execute stmt_sf; +--echo # XXX: used to be a bug +execute stmt_sp; +# +--echo # XXX: used to be a bug +execute stmt_sf; +--echo # XXX: used to be a bug +execute stmt_sp; + +connection default; === modified file 'mysql-test/r/ps_ddl.result' --- a/mysql-test/r/ps_ddl.result 2008-07-03 19:41:22 +0000 +++ b/mysql-test/r/ps_ddl.result 2008-08-13 19:42:21 +0000 @@ -1567,11 +1567,13 @@ drop function if exists f_12093; drop function if exists f_12093_unrelated; drop procedure if exists p_12093; +drop view if exists v_12093_unrelated; create table t_12093 (a int); create function f_12093() returns int return (select count(*) from t_12093); create procedure p_12093(a int) select * from t_12093; create function f_12093_unrelated() returns int return 2; create procedure p_12093_unrelated() begin end; +create view v_12093_unrelated as select * from t_12093; prepare stmt_sf from 'select f_12093();'; prepare stmt_sp from 'call p_12093(f_12093())'; execute stmt_sf; @@ -1580,6 +1582,27 @@ execute stmt_sp; a drop function f_12093_unrelated; +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +prepare stmt_sf from 'select f_12093();'; +prepare stmt_sp from 'call p_12093(f_12093())'; +execute stmt_sf; +f_12093() +0 +execute stmt_sp; +a drop procedure p_12093_unrelated; # XXX: used to be a bug execute stmt_sf; @@ -1595,7 +1618,29 @@ # XXX: used to be a bug execute stmt_sp; a -call p_verify_reprepare_count(2); +prepare stmt_sf from 'select f_12093();'; +prepare stmt_sp from 'call p_12093(f_12093())'; +execute stmt_sf; +f_12093() +0 +execute stmt_sp; +a +drop view v_12093_unrelated; +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +call p_verify_reprepare_count(6); SUCCESS drop table t_12093; === modified file 'mysql-test/t/ps_ddl.test' --- a/mysql-test/t/ps_ddl.test 2008-07-03 19:41:22 +0000 +++ b/mysql-test/t/ps_ddl.test 2008-08-13 19:42:21 +0000 @@ -1363,44 +1363,34 @@ drop function if exists f_12093; drop function if exists f_12093_unrelated; drop procedure if exists p_12093; +drop view if exists v_12093_unrelated; --enable_warnings create table t_12093 (a int); - create function f_12093() returns int return (select count(*) from t_12093); - create procedure p_12093(a int) select * from t_12093; create function f_12093_unrelated() returns int return 2; create procedure p_12093_unrelated() begin end; - -prepare stmt_sf from 'select f_12093();'; -prepare stmt_sp from 'call p_12093(f_12093())'; - -execute stmt_sf; -execute stmt_sp; +create view v_12093_unrelated as select * from t_12093; connect (con1,localhost,root,,); -connection con1; - -drop function f_12093_unrelated; -drop procedure p_12093_unrelated; - connection default; ---echo # XXX: used to be a bug -execute stmt_sf; ---echo # XXX: used to be a bug -execute stmt_sp; +let $my_drop = drop function f_12093_unrelated; +--source include/ps_ddl_1.inc +# +let $my_drop = drop procedure p_12093_unrelated; +--source include/ps_ddl_1.inc +# +# A reprepare of stmt_sf and stmt_sp is necessary because there is no +# information about views within the table definition cache. +let $my_drop = drop view v_12093_unrelated; +--source include/ps_ddl_1.inc ---echo # XXX: used to be a bug -execute stmt_sf; ---echo # XXX: used to be a bug -execute stmt_sp; -call p_verify_reprepare_count(2); +call p_verify_reprepare_count(6); disconnect con1; - drop table t_12093; drop function f_12093; drop procedure p_12093; --===============8045762775640490392==--