List:Commits« Previous MessageNext Message »
From:Horst.Hunger Date:February 17 2011 3:36pm
Subject:bzr commit into mysql-trunk branch (horst.hunger:3572) WL#5217
View as plain text  
#At file:///home/horst/bzr/trunk-5217/ based on revid:mattias.jonsson@stripped

 3572 Horst.Hunger	2011-02-17
      Tests for QA sign off WL#5217.

    added:
      mysql-test/suite/parts/inc/partition-dml-1-1-modes.inc
      mysql-test/suite/parts/inc/partition-dml-1-1.inc
      mysql-test/suite/parts/inc/partition-dml-1-10.inc
      mysql-test/suite/parts/inc/partition-dml-1-11.inc
      mysql-test/suite/parts/inc/partition-dml-1-2.inc
      mysql-test/suite/parts/inc/partition-dml-1-3.inc
      mysql-test/suite/parts/inc/partition-dml-1-4.inc
      mysql-test/suite/parts/inc/partition-dml-1-5.inc
      mysql-test/suite/parts/inc/partition-dml-1-6.inc
      mysql-test/suite/parts/inc/partition-dml-1-7.inc
      mysql-test/suite/parts/inc/partition-dml-1-8.inc
      mysql-test/suite/parts/inc/partition-dml-1-9.inc
      mysql-test/suite/parts/inc/partition-dml_cr_tab.inc
      mysql-test/suite/parts/inc/partition-dml_ins_tab.inc
      mysql-test/suite/parts/inc/rpl-partition-dml-1-1.inc
      mysql-test/suite/parts/r/partition-dml-1-1-innodb-modes.result
      mysql-test/suite/parts/r/partition-dml-1-1-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-1-myisam-modes.result
      mysql-test/suite/parts/r/partition-dml-1-1-myisam.result
      mysql-test/suite/parts/r/partition-dml-1-10-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-10-myisam.result
      mysql-test/suite/parts/r/partition-dml-1-11-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-11-myisam.result
      mysql-test/suite/parts/r/partition-dml-1-2-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-2-myisam.result
      mysql-test/suite/parts/r/partition-dml-1-3-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-4-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-5-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-6-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-7-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-8-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-9-innodb.result
      mysql-test/suite/parts/r/partition-dml-1-9-myisam.result
      mysql-test/suite/parts/r/rpl-partition-dml-1-1-innodb.result
      mysql-test/suite/parts/r/rpl-partition-dml-1-1-myisam.result
      mysql-test/suite/parts/t/partition-dml-1-1-innodb-modes.test
      mysql-test/suite/parts/t/partition-dml-1-1-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-1-myisam-modes.test
      mysql-test/suite/parts/t/partition-dml-1-1-myisam.test
      mysql-test/suite/parts/t/partition-dml-1-10-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-10-myisam.test
      mysql-test/suite/parts/t/partition-dml-1-11-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-11-myisam.test
      mysql-test/suite/parts/t/partition-dml-1-2-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-2-myisam.test
      mysql-test/suite/parts/t/partition-dml-1-3-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-4-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-5-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-6-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-7-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-8-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-9-innodb.test
      mysql-test/suite/parts/t/partition-dml-1-9-myisam.test
      mysql-test/suite/parts/t/rpl-partition-dml-1-1-innodb.test
      mysql-test/suite/parts/t/rpl-partition-dml-1-1-myisam.test
=== added file 'mysql-test/suite/parts/inc/partition-dml-1-1-modes.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-1-modes.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-1-modes.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,213 @@
+let $DATA_PATH=;
+let $INDEX_PATH=;
+--source include/have_partition.inc
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+
+--echo # Run in empty mode
+set @@global.sql_mode= '';
+--echo #######################################################
+--echo # UPDATE without partition selection
+
+connect (session1, localhost, test_user_1,'testpw',test);
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='table-upd-1';
+--source include/wait_condition.inc
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo reap
+reap;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+--echo #######################################################
+--echo # UPDATE with partition selection
+#connect (session1, localhost, test_user_1,'testpw',test);
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+
+#connect (session2, localhost, test_user_2,'testpw',test);
+connection session2;
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='p0-29-upd-1';
+--source include/wait_condition.inc
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo reap
+reap;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+disconnect session1;
+disconnect session2;
+
+connection default;
+DROP TABLE t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+--echo # Run in ANSI mode
+set @@global.sql_mode= ansi;
+--echo #######################################################
+--echo # UPDATE without partition selection
+
+connect (session1, localhost, test_user_1,'testpw',test);
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='table-upd-1';
+--source include/wait_condition.inc
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo reap
+reap;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+--echo #######################################################
+--echo # UPDATE with partition selection
+#connect (session1, localhost, test_user_1,'testpw',test);
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+
+#connect (session2, localhost, test_user_2,'testpw',test);
+connection session2;
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='p0-29-upd-1';
+--source include/wait_condition.inc
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo reap
+reap;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+disconnect session1;
+disconnect session2;
+
+connection default;
+DROP TABLE t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+--echo # Run in traditional mode
+set @@global.sql_mode= traditional;
+--echo #######################################################
+--echo # UPDATE without partition selection
+
+connect (session1, localhost, test_user_1,'testpw',test);
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='table-upd-1';
+--source include/wait_condition.inc
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo reap
+reap;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+--echo #######################################################
+--echo # UPDATE with partition selection
+#connect (session1, localhost, test_user_1,'testpw',test);
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+
+#connect (session2, localhost, test_user_2,'testpw',test);
+connection session2;
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='p0-29-upd-1';
+--source include/wait_condition.inc
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo reap
+reap;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-1.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-1.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-1.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,102 @@
+let $DATA_PATH=;
+let $INDEX_PATH=;
+--source include/have_partition.inc
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='p0-29-upd-1';
+--source include/wait_condition.inc
+--sorted_result
+SELECT * FROM t1 PARTITION (`p30-299`);
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p30-299`);
+--sorted_result
+SELECT * FROM t1 PARTITION (`p300-2999`);
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p300-2999`);
+--sorted_result
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+--sorted_result
+SELECT * FROM t1 PARTITION (subp3);
+--sorted_result
+SELECT * FROM t1 PARTITION (subp4);
+--sorted_result
+SELECT * FROM t1 PARTITION (subp5);
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+
+connection session1;
+--echo reap
+reap;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+SELECT 
+(SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) = 
+(SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
+
+# 2) empty (sub)partitions 
+let $TABLENAME= t2;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+
+SELECT * FROM t2 PARTITION (`p30-299`);
+UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t2 PARTITION (`p300-2999`);
+UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t2 PARTITION (`p3000-299999`);
+UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t2 PARTITION (`p0-29`);
+UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
+UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
+DELETE FROM t2 PARTITION (subp3);
+UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
+DELETE FROM t2 PARTITION (subp4);
+UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
+DELETE FROM t2 PARTITION (subp5);
+UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
+DELETE FROM t2 PARTITION (subp4,subp5,subp3);
+SELECT * FROM t2 PARTITION (subp3);
+SELECT * FROM t2 PARTITION (subp4);
+SELECT * FROM t2 PARTITION (subp5);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1, t2;
+DROP USER test_user_1;
+DROP USER test_user_2;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-10.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-10.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-10.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,81 @@
+--source include/have_partition.inc
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+let $DATA_PATH=;
+let $INDEX_PATH=;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+PREPARE st1 FROM 'UPDATE t1 PARTITION (`p0-29`) SET b=''p0-29-upd-1'' WHERE a BETWEEN 0 AND 9' ;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+PREPARE st2 FROM 'UPDATE t1 PARTITION (`p0-29`) SET b=? WHERE a BETWEEN 20 AND 29' ;
+
+connection session1;
+EXECUTE st1;
+
+connection session2;
+SET @var1= 'p0-29-upd-2';
+if ($engine == MyISAM)
+{
+EXECUTE st2 USING @var1;
+}
+if ($engine == InnoDB)
+{
+--error ER_LOCK_WAIT_TIMEOUT
+EXECUTE st2 USING @var1;
+}
+
+connection session1;
+COMMIT WORK;
+
+connection session2;
+SET @var1= 'p0-29-upd-2';
+EXECUTE st2 USING @var1;
+
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+DEALLOCATE PREPARE st1;
+
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+COMMIT WORK;
+DEALLOCATE PREPARE st2;
+
+connection default;
+disconnect session1;
+disconnect session2;
+
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-11.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-11.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-11.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,122 @@
+# DATA DIRECTORY
+# Make directory for partition data
+let $data_dir_path= $MYSQLTEST_VARDIR/mysql-test-data-dir;
+--mkdir $data_dir_path
+let $DATA_PATH= DATA DIRECTORY = '$data_dir_path';
+
+# INDEX DIRECTORY
+# Make directory for partition index
+let $idx_dir_path= $MYSQLTEST_VARDIR/mysql-test-idx-dir;
+--mkdir $idx_dir_path
+let $INDEX_PATH= INDEX DIRECTORY = '$idx_dir_path';
+
+--source include/have_partition.inc
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--disable_result_log
+--disable_query_log
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--enable_result_log
+--enable_query_log
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--echo send
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='p0-29-upd-1';
+--source include/wait_condition.inc
+--sorted_result
+SELECT * FROM t1 PARTITION (`p30-299`);
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p30-299`);
+--sorted_result
+SELECT * FROM t1 PARTITION (`p300-2999`);
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p300-2999`);
+--sorted_result
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+--sorted_result
+SELECT * FROM t1 PARTITION (subp3);
+--sorted_result
+SELECT * FROM t1 PARTITION (subp4);
+--sorted_result
+SELECT * FROM t1 PARTITION (subp5);
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+
+connection session1;
+--echo reap
+reap;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+SELECT 
+(SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) = 
+(SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
+
+# 2) empty (sub)partitions 
+let $TABLENAME= t2;
+--disable_result_log
+--disable_query_log
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--enable_result_log
+--enable_query_log
+
+SELECT * FROM t2 PARTITION (`p30-299`);
+UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t2 PARTITION (`p300-2999`);
+UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t2 PARTITION (`p3000-299999`);
+UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t2 PARTITION (`p0-29`);
+UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
+UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
+DELETE FROM t2 PARTITION (subp3);
+UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
+DELETE FROM t2 PARTITION (subp4);
+UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
+DELETE FROM t2 PARTITION (subp5);
+UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
+DELETE FROM t2 PARTITION (subp4,subp5,subp3);
+SELECT * FROM t2 PARTITION (subp3);
+SELECT * FROM t2 PARTITION (subp4);
+SELECT * FROM t2 PARTITION (subp5);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1, t2;
+--rmdir $data_dir_path
+--rmdir $idx_dir_path
+DROP USER test_user_1;
+DROP USER test_user_2;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-2.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-2.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-2.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,86 @@
+let $DATA_PATH=;
+let $INDEX_PATH=;
+--source include/have_partition.inc
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+let $TABLENAME= t2;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+
+delimiter //;
+CREATE
+PROCEDURE p1 ()
+BEGIN
+DECLARE c11,c21 int;
+DECLARE c12,c22 varchar(64);
+DECLARE cur1 CURSOR FOR SELECT * FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`) ORDER BY a,b;
+DECLARE cur2 CURSOR FOR SELECT * FROM t1 ORDER BY a,b;
+DECLARE CONTINUE HANDLER FOR NOT FOUND SET @done = 1;
+OPEN cur1;
+OPEN cur2;
+read_loop: LOOP
+  FETCH cur1 INTO c11,c12;
+  FETCH cur2 INTO c21,c22;
+  IF !((c11=c21) AND (c12=c22)) THEN
+  SELECT c11,c12,c21,c22;
+  LEAVE read_loop;
+  END IF;
+  IF @done THEN
+  LEAVE read_loop;
+  END IF;
+END LOOP;
+CLOSE cur1;
+CLOSE cur2;
+END//
+
+CREATE PROCEDURE p2 ()
+BEGIN
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd' WHERE a BETWEEN 3 AND 10;
+END//
+
+CREATE PROCEDURE p3 ()
+BEGIN
+DELETE FROM t1 PARTITION (`p0-29`) WHERE b= 'p0-29-upd';
+END//
+
+CREATE TRIGGER tr1 AFTER INSERT ON t2
+FOR EACH ROW BEGIN
+    UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd-trigger' WHERE a BETWEEN 30 AND 40;
+END//
+
+delimiter ;//
+
+--disable_warnings
+CALL p1;
+--enable_warnings
+CALL p2;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+SELECT * FROM t1 WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+CALL p3;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+CALL p3;
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+SELECT * FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+SELECT * FROM t1 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 40 ORDER BY a,b ;
+
+DELETE FROM t1 PARTITION (pneg, `p30-299`);
+SELECT * FROM t1 ORDER BY a,b;
+
+--echo ########## Empty table t1 #########
+DELETE FROM t1;
+--disable_warnings
+CALL p1;
+--enable_warnings
+CALL p2;
+CALL p3;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+DROP TABLE t2;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-3.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-3.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-3.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,82 @@
+--source include/have_partition.inc
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+let $DATA_PATH=;
+let $INDEX_PATH=;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd-1' WHERE a BETWEEN 30 AND 39;
+
+connection session1;
+--echo ####### expect only p0-29 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connection session2;
+--echo ####### expect only p30-299 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connection session1;
+COMMIT WORK;
+--echo ####### expect only p0-29 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connection session2;
+--echo ####### expect only p30-299 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connect (session3, localhost, test_user_3,'testpw',test);
+--echo ####### expect only p0-29 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+disconnect session3;
+
+connection session2;
+COMMIT WORK;
+--echo ####### expect p0-29 and p30-299 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connection session1;
+--echo ####### expect only p30-299 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+COMMIT WORK;
+--echo ####### expect p0-29 and p30-299 is updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-4.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-4.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-4.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,60 @@
+--source include/have_partition.inc
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'serializable';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+SELECT @@global.innodb_lock_wait_timeout;
+let $DATA_PATH=;
+let $INDEX_PATH=;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connect (session2, localhost, test_user_1,'testpw',test);
+--echo ####### expect p30-299 is readable, p0-29 is locked
+--sorted_result
+SELECT * FROM t1 PARTITION (`p30-299`);
+--error ER_LOCK_WAIT_TIMEOUT 
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+COMMIT WORK;
+
+connection session2;
+--echo ####### expect p0-29 and p30-299 are readable
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-5.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-5.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-5.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,58 @@
+--source include/have_partition.inc
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'read-committed';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+SELECT @@global.innodb_lock_wait_timeout;
+let $DATA_PATH=;
+let $INDEX_PATH=;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connect (session2, localhost, test_user_1,'testpw',test);
+--echo ####### expect not to see the updated values
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connection session1;
+COMMIT WORK;
+
+connection session2;
+--echo ####### expect to see the updated values.
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-6.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-6.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-6.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,58 @@
+--source include/have_partition.inc
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'read-uncommitted';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+SELECT @@global.innodb_lock_wait_timeout;
+let $DATA_PATH=;
+let $INDEX_PATH=;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connect (session2, localhost, test_user_1,'testpw',test);
+--echo ####### expect not to see the updated values
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+connection session1;
+COMMIT WORK;
+
+connection session2;
+--echo ####### expect to see the updated values.
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-7.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-7.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-7.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,91 @@
+--source include/have_partition.inc
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+let $DATA_PATH=;
+let $INDEX_PATH=;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+eval DROP INDEX ind_$TABLENAME ON $TABLENAME;
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9 ;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+--echo ####### expect p0-29 has not been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+
+connection session1;
+COMMIT WORK;
+--echo ####### expect p0-29 (0-9) has been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+--echo ####### expect p0-29 has not been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 20 AND 29 ;
+
+connection session1;
+--echo ####### expect only p0-29 (0-9) has been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+
+connection session2;
+COMMIT WORK;
+--echo ####### expect p0-29 is completely updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo ####### expect only p0-29 (0-9) has been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+COMMIT WORK;
+--echo ####### expect p0-29 is completely updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-8.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-8.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-8.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,91 @@
+--source include/have_partition.inc
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+let $DATA_PATH=;
+let $INDEX_PATH=;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9 ;
+
+connect (session2, localhost, test_user_2,'testpw',test);
+--echo ####### expect p0-29 has not been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+
+connection session1;
+COMMIT WORK;
+--echo ####### expect p0-29 (0-9) has been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session2;
+--echo ####### expect p0-29 has not been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 20 AND 29 ;
+
+connection session1;
+--echo ####### expect only p0-29 (0-9) has been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+--error ER_LOCK_WAIT_TIMEOUT
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+
+connection session2;
+COMMIT WORK;
+--echo ####### expect p0-29 is completely updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection session1;
+--echo ####### expect only p0-29 (0-9) has been updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+COMMIT WORK;
+--echo ####### expect p0-29 is completely updated
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml-1-9.inc'
--- a/mysql-test/suite/parts/inc/partition-dml-1-9.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml-1-9.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,190 @@
+let $DATA_PATH=;
+let $INDEX_PATH=;
+--source include/have_partition.inc
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+let $TABLENAME= t2;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+
+connect (session1, localhost, test_user_1,'testpw',test);
+--sorted_result
+CREATE VIEW v1 AS
+SELECT t1.a, t2.b FROM t1 PARTITION (`p0-29`), t2 
+WHERE t1.a = t2.a;
+SELECT * FROM v1;
+
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--sorted_result
+SELECT * FROM t2 PARTITION (`p30-299`);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+
+--sorted_result
+SELECT * FROM t1 PARTITION (subp3);
+--sorted_result
+SELECT * FROM t2 PARTITION (subp6);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (subp3), 
+t2 PARTITION (subp6);
+
+--sorted_result
+SELECT * FROM t1 PARTITION (subp3,subp5);
+--sorted_result
+SELECT * FROM t2 PARTITION (subp6,subp8);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (subp3,subp5), 
+t2 PARTITION (subp6,subp8);
+
+DELETE FROM t2 PARTITION (`p30-299`);
+
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--sorted_result
+SELECT * FROM t2  PARTITION (`p30-299`);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+LEFT JOIN
+t2 
+USING (a,b);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 
+LEFT JOIN
+t2 PARTITION (`p0-29`,`p30-299`) 
+USING (a,b);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+RIGHT JOIN
+t2 
+USING (a,b);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 
+RIGHT JOIN
+t2 PARTITION (`p0-29`,`p30-299`) 
+USING (a,b);
+
+DELETE FROM t1 PARTITION (`p0-29`);
+
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--sorted_result
+SELECT * FROM t2  PARTITION (`p30-299`);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+
+INSERT INTO t1 VALUES (1,'t1-p0-29-ins');
+
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--sorted_result
+SELECT * FROM t2  PARTITION (`p30-299`);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+
+INSERT INTO t2 VALUES (32,'t2-p30-299-ins');
+
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+--sorted_result
+SELECT * FROM t2  PARTITION (`p30-299`);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+
+DELETE FROM t1 PARTITION (`p30-299`);
+INSERT INTO t1 VALUES (31,'t1-p30-299-ins');
+DELETE FROM t2 PARTITION (`p0-29`);
+INSERT INTO t2 VALUES (2,'t2-p0-29-ins');
+
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+--sorted_result
+SELECT * FROM t2  PARTITION (`p0-29`,`p30-299`);
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`,`p30-299`), 
+t2 PARTITION (`p0-29`,`p30-299`);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+NATURAL JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+LEFT JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+RIGHT JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+
+INSERT INTO t1 VALUES (32,'t2-p30-299-ins');
+INSERT INTO t2 VALUES (1,'t1-p0-29-ins');
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+
+--sorted_result
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+NATURAL JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+
+disconnect session1;
+connection default;
+DROP VIEW v1;
+DROP TABLE t1, t2;
+DROP USER test_user_1;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml_cr_tab.inc'
--- a/mysql-test/suite/parts/inc/partition-dml_cr_tab.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml_cr_tab.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,31 @@
+eval CREATE TABLE $TABLENAME 
+(a INT NOT NULL,
+ b varchar (64),
+ INDEX ind_$TABLENAME (b,a),
+ PRIMARY KEY (a))
+ENGINE = $ENGINE
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+ (SUBPARTITION subp0 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp1 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp2 $DATA_PATH $INDEX_PATH),
+ PARTITION `p0-29` VALUES LESS THAN (30)
+ (SUBPARTITION subp3 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp4 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp5 $DATA_PATH $INDEX_PATH),
+ PARTITION `p30-299` VALUES LESS THAN (300)
+ (SUBPARTITION subp6 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp7 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp8 $DATA_PATH $INDEX_PATH),
+ PARTITION `p300-2999` VALUES LESS THAN (3000)
+ (SUBPARTITION subp9 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp10 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp11 $DATA_PATH $INDEX_PATH),
+ PARTITION `p3000-299999` VALUES LESS THAN (300000)
+ (SUBPARTITION subp12 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp13 $DATA_PATH $INDEX_PATH,
+  SUBPARTITION subp14 $DATA_PATH $INDEX_PATH));
+
+#eval SHOW CREATE TABLE $TABLENAME;
+

=== added file 'mysql-test/suite/parts/inc/partition-dml_ins_tab.inc'
--- a/mysql-test/suite/parts/inc/partition-dml_ins_tab.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/partition-dml_ins_tab.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,40 @@
+eval INSERT INTO $TABLENAME PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+eval INSERT INTO $TABLENAME PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+eval INSERT INTO $TABLENAME PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+eval INSERT INTO $TABLENAME PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+eval INSERT INTO $TABLENAME PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+eval INSERT INTO $TABLENAME PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+
+eval INSERT INTO $TABLENAME PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+eval INSERT INTO $TABLENAME PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+eval INSERT INTO $TABLENAME PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+eval INSERT INTO $TABLENAME PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+eval INSERT INTO $TABLENAME PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+

=== added file 'mysql-test/suite/parts/inc/rpl-partition-dml-1-1.inc'
--- a/mysql-test/suite/parts/inc/rpl-partition-dml-1-1.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/inc/rpl-partition-dml-1-1.inc	2011-02-17 15:36:05 +0000
@@ -0,0 +1,80 @@
+let $DATA_PATH=;
+let $INDEX_PATH=;
+--source include/have_partition.inc
+--source include/master-slave.inc
+set @old_global_binlog_format=  @@global.binlog_format;
+set @old_session_binlog_format=  @@session.binlog_format;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+--echo [on slave]
+connection slave;
+set @old_global_binlog_format=  @@global.binlog_format;
+set @old_session_binlog_format=  @@session.binlog_format;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+# restart slave so that slave sql thread's binlog format is re-read
+# from @@global.binlog_format
+--source include/stop_slave.inc
+--source include/start_slave.inc
+
+connection master;
+
+--echo # Additional tests for WL#5217 by QA, testplan 1.1
+
+let $TABLENAME= t1;
+--source suite/parts/inc/partition-dml_cr_tab.inc
+--source suite/parts/inc/partition-dml_ins_tab.inc
+
+--enable_connect_log
+
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+--sync_slave_with_master
+--source include/check_slave_is_running.inc
+--sorted_result
+SELECT * FROM t1 PARTITION (`p0-29`);
+
+connection master;
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p30-299`);
+
+--sync_slave_with_master
+--source include/check_slave_is_running.inc
+--sorted_result
+SELECT * FROM t1 PARTITION (`p30-299`);
+
+connection master;
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+--sorted_result
+SELECT * FROM t1 PARTITION (`p300-2999`);
+
+--sync_slave_with_master
+--source include/check_slave_is_running.inc
+--sorted_result
+SELECT * FROM t1 PARTITION (`p300-2999`);
+
+connection master;
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+--sorted_result
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+
+--sync_slave_with_master
+--source include/check_slave_is_running.inc
+--sorted_result
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+set @@global.binlog_format=  @old_global_binlog_format;
+set @@session.binlog_format=  @old_session_binlog_format;
+
+connection master;
+set @@global.binlog_format=  @old_global_binlog_format;
+set @@session.binlog_format=  @old_session_binlog_format;
+DROP TABLE t1;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-1-innodb-modes.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-1-innodb-modes.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-1-innodb-modes.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,655 @@
+set @save_sqlmode= @@global.sql_mode;
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+# Run in empty mode
+set @@global.sql_mode= '';
+#######################################################
+# UPDATE without partition selection
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+11	table-ins
+12	table-ins
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+#######################################################
+# UPDATE with partition selection
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connection session2;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+11	(p0-29-)ins
+12	(p0-29-)ins
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+# Run in ANSI mode
+set @@global.sql_mode= ansi;
+#######################################################
+# UPDATE without partition selection
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+11	table-ins
+12	table-ins
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+#######################################################
+# UPDATE with partition selection
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connection session2;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+11	(p0-29-)ins
+12	(p0-29-)ins
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+# Run in traditional mode
+set @@global.sql_mode= traditional;
+#######################################################
+# UPDATE without partition selection
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+11	table-ins
+12	table-ins
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+#######################################################
+# UPDATE with partition selection
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connection session2;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+11	(p0-29-)ins
+12	(p0-29-)ins
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+set @@global.sql_mode= @save_sqlmode;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-1-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-1-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-1-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,262 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	p3000-299999-upd
+3002	p3000-299999-upd
+3003	p3000-299999-upd
+3004	p3000-299999-upd
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-2
+2	p0-29-upd-2
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-2
+4	p0-29-upd-2
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+SELECT * FROM t1 PARTITION (subp3);
+a	b
+21	subp3-upd
+24	subp3-upd
+3	subp3-upd
+SELECT * FROM t1 PARTITION (subp4);
+a	b
+1	subp4-upd
+22	subp4-upd
+4	subp4-upd
+SELECT * FROM t1 PARTITION (subp5);
+a	b
+2	subp5-upd
+23	subp5-upd
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+3	subp3-upd
+21	subp3-upd
+24	subp3-upd
+1	subp4-upd
+4	subp4-upd
+22	subp4-upd
+2	subp5-upd
+23	subp5-upd
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+SELECT 
+(SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) = 
+(SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
+MUST BE TRUE (1)
+1
+CREATE TABLE t2 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t2 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+SELECT * FROM t2 PARTITION (`p30-299`);
+a	b
+UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t2 PARTITION (`p300-2999`);
+a	b
+UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t2 PARTITION (`p3000-299999`);
+a	b
+UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t2 PARTITION (`p0-29`);
+a	b
+UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
+UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
+DELETE FROM t2 PARTITION (subp3);
+UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
+DELETE FROM t2 PARTITION (subp4);
+UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
+DELETE FROM t2 PARTITION (subp5);
+UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
+DELETE FROM t2 PARTITION (subp4,subp5,subp3);
+SELECT * FROM t2 PARTITION (subp3);
+a	b
+SELECT * FROM t2 PARTITION (subp4);
+a	b
+SELECT * FROM t2 PARTITION (subp5);
+a	b
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1, t2;
+DROP USER test_user_1;
+DROP USER test_user_2;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-1-myisam-modes.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-1-myisam-modes.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-1-myisam-modes.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,655 @@
+set @save_sqlmode= @@global.sql_mode;
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+# Run in empty mode
+set @@global.sql_mode= '';
+#######################################################
+# UPDATE without partition selection
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+11	table-ins
+12	table-ins
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+#######################################################
+# UPDATE with partition selection
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connection session2;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+11	(p0-29-)ins
+12	(p0-29-)ins
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+# Run in ANSI mode
+set @@global.sql_mode= ansi;
+#######################################################
+# UPDATE without partition selection
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+11	table-ins
+12	table-ins
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+#######################################################
+# UPDATE with partition selection
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connection session2;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+11	(p0-29-)ins
+12	(p0-29-)ins
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+# Run in traditional mode
+set @@global.sql_mode= traditional;
+#######################################################
+# UPDATE without partition selection
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+send
+UPDATE t1 SET b='table-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+UPDATE t1 SET b='table-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+INSERT INTO t1 VALUES (11, 'table-ins');
+INSERT INTO t1 VALUES (12, 'table-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+11	table-ins
+12	table-ins
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+DELETE FROM t1 WHERE b= 'table-ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+#######################################################
+# UPDATE with partition selection
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	table-upd-2
+2	table-upd-2
+3	table-upd-2
+4	table-upd-2
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connection session2;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
+INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+11	(p0-29-)ins
+12	(p0-29-)ins
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-2
+2	p0-29-upd-2
+3	p0-29-upd-2
+4	p0-29-upd-2
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+set @@global.sql_mode= @save_sqlmode;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-1-myisam.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-1-myisam.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-1-myisam.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,262 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	p3000-299999-upd
+3002	p3000-299999-upd
+3003	p3000-299999-upd
+3004	p3000-299999-upd
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-2
+2	p0-29-upd-2
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-2
+4	p0-29-upd-2
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+SELECT * FROM t1 PARTITION (subp3);
+a	b
+21	subp3-upd
+24	subp3-upd
+3	subp3-upd
+SELECT * FROM t1 PARTITION (subp4);
+a	b
+1	subp4-upd
+22	subp4-upd
+4	subp4-upd
+SELECT * FROM t1 PARTITION (subp5);
+a	b
+2	subp5-upd
+23	subp5-upd
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+3	subp3-upd
+21	subp3-upd
+24	subp3-upd
+1	subp4-upd
+4	subp4-upd
+22	subp4-upd
+2	subp5-upd
+23	subp5-upd
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+SELECT 
+(SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) = 
+(SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
+MUST BE TRUE (1)
+1
+CREATE TABLE t2 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t2 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+SELECT * FROM t2 PARTITION (`p30-299`);
+a	b
+UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t2 PARTITION (`p300-2999`);
+a	b
+UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t2 PARTITION (`p3000-299999`);
+a	b
+UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t2 PARTITION (`p0-29`);
+a	b
+UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
+UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
+DELETE FROM t2 PARTITION (subp3);
+UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
+DELETE FROM t2 PARTITION (subp4);
+UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
+DELETE FROM t2 PARTITION (subp5);
+UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
+DELETE FROM t2 PARTITION (subp4,subp5,subp3);
+SELECT * FROM t2 PARTITION (subp3);
+a	b
+SELECT * FROM t2 PARTITION (subp4);
+a	b
+SELECT * FROM t2 PARTITION (subp5);
+a	b
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1, t2;
+DROP USER test_user_1;
+DROP USER test_user_2;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-10-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-10-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-10-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,139 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+@@global.lock_wait_timeout
+1
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+PREPARE st1 FROM 'UPDATE t1 PARTITION (`p0-29`) SET b=''p0-29-upd-1'' WHERE a BETWEEN 0 AND 9' ;
+connect  session2, localhost, test_user_2,'testpw',test;
+PREPARE st2 FROM 'UPDATE t1 PARTITION (`p0-29`) SET b=? WHERE a BETWEEN 20 AND 29' ;
+connection session1;
+EXECUTE st1;
+connection session2;
+SET @var1= 'p0-29-upd-2';
+EXECUTE st2 USING @var1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection session1;
+COMMIT WORK;
+connection session2;
+SET @var1= 'p0-29-upd-2';
+EXECUTE st2 USING @var1;
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+1	p0-29-upd-1
+2	p0-29-upd-1
+3	p0-29-upd-1
+4	p0-29-upd-1
+DEALLOCATE PREPARE st1;
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+3	p0-29-upd-1
+4	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+COMMIT WORK;
+DEALLOCATE PREPARE st2;
+connection default;
+disconnect session1;
+disconnect session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+3	p0-29-upd-1
+4	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-10-myisam.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-10-myisam.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-10-myisam.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,138 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+@@global.lock_wait_timeout
+1
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+PREPARE st1 FROM 'UPDATE t1 PARTITION (`p0-29`) SET b=''p0-29-upd-1'' WHERE a BETWEEN 0 AND 9' ;
+connect  session2, localhost, test_user_2,'testpw',test;
+PREPARE st2 FROM 'UPDATE t1 PARTITION (`p0-29`) SET b=? WHERE a BETWEEN 20 AND 29' ;
+connection session1;
+EXECUTE st1;
+connection session2;
+SET @var1= 'p0-29-upd-2';
+EXECUTE st2 USING @var1;
+connection session1;
+COMMIT WORK;
+connection session2;
+SET @var1= 'p0-29-upd-2';
+EXECUTE st2 USING @var1;
+connection session1;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+3	p0-29-upd-1
+4	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+DEALLOCATE PREPARE st1;
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+3	p0-29-upd-1
+4	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+COMMIT WORK;
+DEALLOCATE PREPARE st2;
+connection default;
+disconnect session1;
+disconnect session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+3	p0-29-upd-1
+4	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-11-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-11-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-11-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,206 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	p3000-299999-upd
+3002	p3000-299999-upd
+3003	p3000-299999-upd
+3004	p3000-299999-upd
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-2
+2	p0-29-upd-2
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-2
+4	p0-29-upd-2
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+SELECT * FROM t1 PARTITION (subp3);
+a	b
+21	subp3-upd
+24	subp3-upd
+3	subp3-upd
+SELECT * FROM t1 PARTITION (subp4);
+a	b
+1	subp4-upd
+22	subp4-upd
+4	subp4-upd
+SELECT * FROM t1 PARTITION (subp5);
+a	b
+2	subp5-upd
+23	subp5-upd
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+3	subp3-upd
+21	subp3-upd
+24	subp3-upd
+1	subp4-upd
+4	subp4-upd
+22	subp4-upd
+2	subp5-upd
+23	subp5-upd
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+SELECT 
+(SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) = 
+(SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
+MUST BE TRUE (1)
+1
+SELECT * FROM t2 PARTITION (`p30-299`);
+a	b
+UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t2 PARTITION (`p300-2999`);
+a	b
+UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t2 PARTITION (`p3000-299999`);
+a	b
+UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t2 PARTITION (`p0-29`);
+a	b
+UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
+UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
+DELETE FROM t2 PARTITION (subp3);
+UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
+DELETE FROM t2 PARTITION (subp4);
+UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
+DELETE FROM t2 PARTITION (subp5);
+UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
+DELETE FROM t2 PARTITION (subp4,subp5,subp3);
+SELECT * FROM t2 PARTITION (subp3);
+a	b
+SELECT * FROM t2 PARTITION (subp4);
+a	b
+SELECT * FROM t2 PARTITION (subp5);
+a	b
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1, t2;
+DROP USER test_user_1;
+DROP USER test_user_2;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-11-myisam.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-11-myisam.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-11-myisam.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,206 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+send
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t1 PARTITION (`p3000-299999`);
+a	b
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+3001	p3000-299999-upd
+3002	p3000-299999-upd
+3003	p3000-299999-upd
+3004	p3000-299999-upd
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-2
+2	p0-29-upd-2
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-2
+4	p0-29-upd-2
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+SELECT * FROM t1 PARTITION (subp3);
+a	b
+21	subp3-upd
+24	subp3-upd
+3	subp3-upd
+SELECT * FROM t1 PARTITION (subp4);
+a	b
+1	subp4-upd
+22	subp4-upd
+4	subp4-upd
+SELECT * FROM t1 PARTITION (subp5);
+a	b
+2	subp5-upd
+23	subp5-upd
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+3	subp3-upd
+21	subp3-upd
+24	subp3-upd
+1	subp4-upd
+4	subp4-upd
+22	subp4-upd
+2	subp5-upd
+23	subp5-upd
+connection session1;
+reap
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+connection session2;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+SELECT 
+(SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) = 
+(SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
+MUST BE TRUE (1)
+1
+SELECT * FROM t2 PARTITION (`p30-299`);
+a	b
+UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t2 PARTITION (`p300-2999`);
+a	b
+UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t2 PARTITION (`p3000-299999`);
+a	b
+UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
+DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
+SELECT * FROM t2 PARTITION (`p0-29`);
+a	b
+UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
+DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
+UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
+DELETE FROM t2 PARTITION (subp3);
+UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
+DELETE FROM t2 PARTITION (subp4);
+UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
+DELETE FROM t2 PARTITION (subp5);
+UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
+DELETE FROM t2 PARTITION (subp4,subp5,subp3);
+SELECT * FROM t2 PARTITION (subp3);
+a	b
+SELECT * FROM t2 PARTITION (subp4);
+a	b
+SELECT * FROM t2 PARTITION (subp5);
+a	b
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1, t2;
+DROP USER test_user_1;
+DROP USER test_user_2;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-2-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-2-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-2-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,181 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+CREATE TABLE t2 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t2 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+CREATE
+PROCEDURE p1 ()
+BEGIN
+DECLARE c11,c21 int;
+DECLARE c12,c22 varchar(64);
+DECLARE cur1 CURSOR FOR SELECT * FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`) ORDER BY a,b;
+DECLARE cur2 CURSOR FOR SELECT * FROM t1 ORDER BY a,b;
+DECLARE CONTINUE HANDLER FOR NOT FOUND SET @done = 1;
+OPEN cur1;
+OPEN cur2;
+read_loop: LOOP
+FETCH cur1 INTO c11,c12;
+FETCH cur2 INTO c21,c22;
+IF !((c11=c21) AND (c12=c22)) THEN
+SELECT c11,c12,c21,c22;
+LEAVE read_loop;
+END IF;
+IF @done THEN
+LEAVE read_loop;
+END IF;
+END LOOP;
+CLOSE cur1;
+CLOSE cur2;
+END//
+CREATE PROCEDURE p2 ()
+BEGIN
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd' WHERE a BETWEEN 3 AND 10;
+END//
+CREATE PROCEDURE p3 ()
+BEGIN
+DELETE FROM t1 PARTITION (`p0-29`) WHERE b= 'p0-29-upd';
+END//
+CREATE TRIGGER tr1 AFTER INSERT ON t2
+FOR EACH ROW BEGIN
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd-trigger' WHERE a BETWEEN 30 AND 40;
+END//
+CALL p1;
+CALL p2;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+3	p0-29-upd
+4	p0-29-upd
+SELECT * FROM t1 WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+3	p0-29-upd
+4	p0-29-upd
+CALL p3;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+CALL p3;
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+SELECT * FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+4	(p0-29-)subp3
+SELECT * FROM t1 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 40 ORDER BY a,b ;
+a	b
+31	p30-299-upd-trigger
+32	p30-299-upd-trigger
+33	p30-299-upd-trigger
+34	p30-299-upd-trigger
+DELETE FROM t1 PARTITION (pneg, `p30-299`);
+SELECT * FROM t1 ORDER BY a,b;
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+########## Empty table t1 #########
+DELETE FROM t1;
+CALL p1;
+CALL p2;
+CALL p3;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+DROP TABLE t2;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-2-myisam.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-2-myisam.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-2-myisam.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,181 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+CREATE TABLE t2 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t2 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+CREATE
+PROCEDURE p1 ()
+BEGIN
+DECLARE c11,c21 int;
+DECLARE c12,c22 varchar(64);
+DECLARE cur1 CURSOR FOR SELECT * FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`) ORDER BY a,b;
+DECLARE cur2 CURSOR FOR SELECT * FROM t1 ORDER BY a,b;
+DECLARE CONTINUE HANDLER FOR NOT FOUND SET @done = 1;
+OPEN cur1;
+OPEN cur2;
+read_loop: LOOP
+FETCH cur1 INTO c11,c12;
+FETCH cur2 INTO c21,c22;
+IF !((c11=c21) AND (c12=c22)) THEN
+SELECT c11,c12,c21,c22;
+LEAVE read_loop;
+END IF;
+IF @done THEN
+LEAVE read_loop;
+END IF;
+END LOOP;
+CLOSE cur1;
+CLOSE cur2;
+END//
+CREATE PROCEDURE p2 ()
+BEGIN
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd' WHERE a BETWEEN 3 AND 10;
+END//
+CREATE PROCEDURE p3 ()
+BEGIN
+DELETE FROM t1 PARTITION (`p0-29`) WHERE b= 'p0-29-upd';
+END//
+CREATE TRIGGER tr1 AFTER INSERT ON t2
+FOR EACH ROW BEGIN
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd-trigger' WHERE a BETWEEN 30 AND 40;
+END//
+CALL p1;
+CALL p2;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+3	p0-29-upd
+4	p0-29-upd
+SELECT * FROM t1 WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+3	p0-29-upd
+4	p0-29-upd
+CALL p3;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+CALL p3;
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+SELECT * FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 3 AND 10 ORDER BY a,b ;
+a	b
+4	(p0-29-)subp3
+SELECT * FROM t1 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 40 ORDER BY a,b ;
+a	b
+31	p30-299-upd-trigger
+32	p30-299-upd-trigger
+33	p30-299-upd-trigger
+34	p30-299-upd-trigger
+DELETE FROM t1 PARTITION (pneg, `p30-299`);
+SELECT * FROM t1 ORDER BY a,b;
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+########## Empty table t1 #########
+DELETE FROM t1;
+CALL p1;
+CALL p2;
+CALL p3;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP TRIGGER tr1;
+DROP TABLE t1;
+DROP TABLE t2;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-3-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-3-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-3-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,247 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+connect  session2, localhost, test_user_2,'testpw',test;
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd-1' WHERE a BETWEEN 30 AND 39;
+connection session1;
+####### expect only p0-29 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+connection session2;
+####### expect only p30-299 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+31	p30-299-upd-1
+32	p30-299-upd-1
+33	p30-299-upd-1
+34	p30-299-upd-1
+4	(p0-29-)subp3
+connection session1;
+COMMIT WORK;
+####### expect only p0-29 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+connection session2;
+####### expect only p30-299 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+31	p30-299-upd-1
+32	p30-299-upd-1
+33	p30-299-upd-1
+34	p30-299-upd-1
+4	(p0-29-)subp3
+connect  session3, localhost, test_user_3,'testpw',test;
+####### expect only p0-29 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+disconnect session3;
+connection session2;
+COMMIT WORK;
+####### expect p0-29 and p30-299 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	p30-299-upd-1
+32	p30-299-upd-1
+33	p30-299-upd-1
+34	p30-299-upd-1
+4	p0-29-upd-1
+connection session1;
+####### expect only p30-299 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+COMMIT WORK;
+####### expect p0-29 and p30-299 is updated
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	p30-299-upd-1
+32	p30-299-upd-1
+33	p30-299-upd-1
+34	p30-299-upd-1
+4	p0-29-upd-1
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-4-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-4-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-4-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,146 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'serializable';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+@@global.lock_wait_timeout
+1
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+connect  session2, localhost, test_user_1,'testpw',test;
+####### expect p30-299 is readable, p0-29 is locked
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+SELECT * FROM t1 PARTITION (`p0-29`);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection session1;
+COMMIT WORK;
+connection session2;
+####### expect p0-29 and p30-299 are readable
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-5-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-5-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-5-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,152 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'read-committed';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+@@global.lock_wait_timeout
+1
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+connect  session2, localhost, test_user_1,'testpw',test;
+####### expect not to see the updated values
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	(p0-29-)subp3
+connection session1;
+COMMIT WORK;
+connection session2;
+####### expect to see the updated values.
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-6-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-6-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-6-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,152 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'read-uncommitted';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+@@global.lock_wait_timeout
+1
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+connect  session2, localhost, test_user_1,'testpw',test;
+####### expect not to see the updated values
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+connection session1;
+COMMIT WORK;
+connection session2;
+####### expect to see the updated values.
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+24	(p0-29-)subp5
+3	p0-29-upd-1
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+4	p0-29-upd-1
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-7-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-7-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-7-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,199 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+@@global.lock_wait_timeout
+1
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+DROP INDEX ind_t1 ON t1;
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9 ;
+connect  session2, localhost, test_user_2,'testpw',test;
+####### expect p0-29 has not been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+3	(p0-29-)subp3
+21	(p0-29-)subp5
+24	(p0-29-)subp5
+1	(p0-29-)subp3
+4	(p0-29-)subp3
+22	(p0-29-)subp5
+2	(p0-29-)subp3
+23	(p0-29-)subp5
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection session1;
+COMMIT WORK;
+####### expect p0-29 (0-9) has been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection session2;
+####### expect p0-29 has not been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 20 AND 29 ;
+connection session1;
+####### expect only p0-29 (0-9) has been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection session2;
+COMMIT WORK;
+####### expect p0-29 is completely updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection session1;
+####### expect only p0-29 (0-9) has been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+COMMIT WORK;
+####### expect p0-29 is completely updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+3	p0-29-upd-1
+4	p0-29-upd-1
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-8-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-8-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-8-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,198 @@
+SET @auto= @@global.autocommit;
+SET @@global.autocommit= off;
+SET @iso= @@global.tx_isolation;
+SET @@global.tx_isolation= 'repeatable-read';
+SET @completion= @@global.completion_type;
+SET @@global.completion_type= 'no_chain';
+SET @lock_timeout= @@global.lock_wait_timeout;
+SET @@global.lock_wait_timeout= 1;
+SELECT @@global.lock_wait_timeout;
+@@global.lock_wait_timeout
+1
+SET @innodb_lock_timeout= @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout= 1;
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+GRANT ALL PRIVILEGES ON test.* TO test_user_3 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9 ;
+connect  session2, localhost, test_user_2,'testpw',test;
+####### expect p0-29 has not been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection session1;
+COMMIT WORK;
+####### expect p0-29 (0-9) has been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection session2;
+####### expect p0-29 has not been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+a	b
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 20 AND 29 ;
+connection session1;
+####### expect only p0-29 (0-9) has been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9 LOCK IN SHARE MODE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1 PARTITION (`p0-29`) WHERE a BETWEEN 20 AND 29 FOR UPDATE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection session2;
+COMMIT WORK;
+####### expect p0-29 is completely updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection session1;
+####### expect only p0-29 (0-9) has been updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+COMMIT WORK;
+####### expect p0-29 is completely updated
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	p0-29-upd-2
+22	p0-29-upd-2
+23	p0-29-upd-2
+24	p0-29-upd-2
+3	p0-29-upd-1
+4	p0-29-upd-1
+disconnect session1;
+disconnect session2;
+connection default;
+DROP TABLE t1;
+DROP USER test_user_1;
+DROP USER test_user_2;
+DROP USER test_user_3;
+SET @@global.autocommit= @auto;
+SET @@global.tx_isolation= @iso;
+SET @@global.completion_type= @completion;
+SET @@global.lock_wait_timeout= @lock_timeout;
+SET @@global.innodb_lock_wait_timeout= @innodb_lock_timeout;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-9-innodb.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-9-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-9-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,545 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+CREATE TABLE t2 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t2 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+CREATE VIEW v1 AS
+SELECT t1.a, t2.b FROM t1 PARTITION (`p0-29`), t2 
+WHERE t1.a = t2.a;
+SELECT * FROM v1;
+a	b
+-4	(pNeg-)subp0
+-3	(pNeg-)subp0
+-2	(pNeg-)subp0
+-1	(pNeg-)subp0
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+SELECT * FROM t2 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+1	231	(p0-29-)subp3	(p30-299-)subp8
+1	232	(p0-29-)subp3	(p30-299-)subp8
+1	233	(p0-29-)subp3	(p30-299-)subp8
+1	234	(p0-29-)subp3	(p30-299-)subp8
+1	31	(p0-29-)subp3	(p30-299-)subp6
+1	32	(p0-29-)subp3	(p30-299-)subp6
+1	33	(p0-29-)subp3	(p30-299-)subp6
+1	34	(p0-29-)subp3	(p30-299-)subp6
+2	231	(p0-29-)subp3	(p30-299-)subp8
+2	232	(p0-29-)subp3	(p30-299-)subp8
+2	233	(p0-29-)subp3	(p30-299-)subp8
+2	234	(p0-29-)subp3	(p30-299-)subp8
+2	31	(p0-29-)subp3	(p30-299-)subp6
+2	32	(p0-29-)subp3	(p30-299-)subp6
+2	33	(p0-29-)subp3	(p30-299-)subp6
+2	34	(p0-29-)subp3	(p30-299-)subp6
+21	231	(p0-29-)subp5	(p30-299-)subp8
+21	232	(p0-29-)subp5	(p30-299-)subp8
+21	233	(p0-29-)subp5	(p30-299-)subp8
+21	234	(p0-29-)subp5	(p30-299-)subp8
+21	31	(p0-29-)subp5	(p30-299-)subp6
+21	32	(p0-29-)subp5	(p30-299-)subp6
+21	33	(p0-29-)subp5	(p30-299-)subp6
+21	34	(p0-29-)subp5	(p30-299-)subp6
+22	231	(p0-29-)subp5	(p30-299-)subp8
+22	232	(p0-29-)subp5	(p30-299-)subp8
+22	233	(p0-29-)subp5	(p30-299-)subp8
+22	234	(p0-29-)subp5	(p30-299-)subp8
+22	31	(p0-29-)subp5	(p30-299-)subp6
+22	32	(p0-29-)subp5	(p30-299-)subp6
+22	33	(p0-29-)subp5	(p30-299-)subp6
+22	34	(p0-29-)subp5	(p30-299-)subp6
+23	231	(p0-29-)subp5	(p30-299-)subp8
+23	232	(p0-29-)subp5	(p30-299-)subp8
+23	233	(p0-29-)subp5	(p30-299-)subp8
+23	234	(p0-29-)subp5	(p30-299-)subp8
+23	31	(p0-29-)subp5	(p30-299-)subp6
+23	32	(p0-29-)subp5	(p30-299-)subp6
+23	33	(p0-29-)subp5	(p30-299-)subp6
+23	34	(p0-29-)subp5	(p30-299-)subp6
+24	231	(p0-29-)subp5	(p30-299-)subp8
+24	232	(p0-29-)subp5	(p30-299-)subp8
+24	233	(p0-29-)subp5	(p30-299-)subp8
+24	234	(p0-29-)subp5	(p30-299-)subp8
+24	31	(p0-29-)subp5	(p30-299-)subp6
+24	32	(p0-29-)subp5	(p30-299-)subp6
+24	33	(p0-29-)subp5	(p30-299-)subp6
+24	34	(p0-29-)subp5	(p30-299-)subp6
+3	231	(p0-29-)subp3	(p30-299-)subp8
+3	232	(p0-29-)subp3	(p30-299-)subp8
+3	233	(p0-29-)subp3	(p30-299-)subp8
+3	234	(p0-29-)subp3	(p30-299-)subp8
+3	31	(p0-29-)subp3	(p30-299-)subp6
+3	32	(p0-29-)subp3	(p30-299-)subp6
+3	33	(p0-29-)subp3	(p30-299-)subp6
+3	34	(p0-29-)subp3	(p30-299-)subp6
+4	231	(p0-29-)subp3	(p30-299-)subp8
+4	232	(p0-29-)subp3	(p30-299-)subp8
+4	233	(p0-29-)subp3	(p30-299-)subp8
+4	234	(p0-29-)subp3	(p30-299-)subp8
+4	31	(p0-29-)subp3	(p30-299-)subp6
+4	32	(p0-29-)subp3	(p30-299-)subp6
+4	33	(p0-29-)subp3	(p30-299-)subp6
+4	34	(p0-29-)subp3	(p30-299-)subp6
+SELECT * FROM t1 PARTITION (subp3);
+a	b
+21	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+SELECT * FROM t2 PARTITION (subp6);
+a	b
+231	(p30-299-)subp8
+234	(p30-299-)subp8
+33	(p30-299-)subp6
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (subp3), 
+t2 PARTITION (subp6);
+t1a	t2a	t1b	t2b
+21	231	(p0-29-)subp5	(p30-299-)subp8
+21	234	(p0-29-)subp5	(p30-299-)subp8
+21	33	(p0-29-)subp5	(p30-299-)subp6
+24	231	(p0-29-)subp5	(p30-299-)subp8
+24	234	(p0-29-)subp5	(p30-299-)subp8
+24	33	(p0-29-)subp5	(p30-299-)subp6
+3	231	(p0-29-)subp3	(p30-299-)subp8
+3	234	(p0-29-)subp3	(p30-299-)subp8
+3	33	(p0-29-)subp3	(p30-299-)subp6
+SELECT * FROM t1 PARTITION (subp3,subp5);
+a	b
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+SELECT * FROM t2 PARTITION (subp6,subp8);
+a	b
+231	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (subp3,subp5), 
+t2 PARTITION (subp6,subp8);
+t1a	t2a	t1b	t2b
+2	231	(p0-29-)subp3	(p30-299-)subp8
+2	233	(p0-29-)subp3	(p30-299-)subp8
+2	234	(p0-29-)subp3	(p30-299-)subp8
+2	32	(p0-29-)subp3	(p30-299-)subp6
+2	33	(p0-29-)subp3	(p30-299-)subp6
+21	231	(p0-29-)subp5	(p30-299-)subp8
+21	233	(p0-29-)subp5	(p30-299-)subp8
+21	234	(p0-29-)subp5	(p30-299-)subp8
+21	32	(p0-29-)subp5	(p30-299-)subp6
+21	33	(p0-29-)subp5	(p30-299-)subp6
+23	231	(p0-29-)subp5	(p30-299-)subp8
+23	233	(p0-29-)subp5	(p30-299-)subp8
+23	234	(p0-29-)subp5	(p30-299-)subp8
+23	32	(p0-29-)subp5	(p30-299-)subp6
+23	33	(p0-29-)subp5	(p30-299-)subp6
+24	231	(p0-29-)subp5	(p30-299-)subp8
+24	233	(p0-29-)subp5	(p30-299-)subp8
+24	234	(p0-29-)subp5	(p30-299-)subp8
+24	32	(p0-29-)subp5	(p30-299-)subp6
+24	33	(p0-29-)subp5	(p30-299-)subp6
+3	231	(p0-29-)subp3	(p30-299-)subp8
+3	233	(p0-29-)subp3	(p30-299-)subp8
+3	234	(p0-29-)subp3	(p30-299-)subp8
+3	32	(p0-29-)subp3	(p30-299-)subp6
+3	33	(p0-29-)subp3	(p30-299-)subp6
+DELETE FROM t2 PARTITION (`p30-299`);
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+LEFT JOIN
+t2 
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+231	NULL	(p30-299-)subp8	NULL
+232	NULL	(p30-299-)subp8	NULL
+233	NULL	(p30-299-)subp8	NULL
+234	NULL	(p30-299-)subp8	NULL
+24	24	(p0-29-)subp5	(p0-29-)subp5
+3	3	(p0-29-)subp3	(p0-29-)subp3
+31	NULL	(p30-299-)subp6	NULL
+32	NULL	(p30-299-)subp6	NULL
+33	NULL	(p30-299-)subp6	NULL
+34	NULL	(p30-299-)subp6	NULL
+4	4	(p0-29-)subp3	(p0-29-)subp3
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 
+LEFT JOIN
+t2 PARTITION (`p0-29`,`p30-299`) 
+USING (a,b);
+t1a	t2a	t1b	t2b
+-1	NULL	(pNeg-)subp0	NULL
+-2	NULL	(pNeg-)subp0	NULL
+-3	NULL	(pNeg-)subp0	NULL
+-4	NULL	(pNeg-)subp0	NULL
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+231	NULL	(p30-299-)subp8	NULL
+232	NULL	(p30-299-)subp8	NULL
+233	NULL	(p30-299-)subp8	NULL
+234	NULL	(p30-299-)subp8	NULL
+24	24	(p0-29-)subp5	(p0-29-)subp5
+299996	NULL	(p3000-299999-)subp14	NULL
+299997	NULL	(p3000-299999-)subp14	NULL
+299998	NULL	(p3000-299999-)subp14	NULL
+299999	NULL	(p3000-299999-)subp14	NULL
+3	3	(p0-29-)subp3	(p0-29-)subp3
+3001	NULL	(p3000-299999-)subp12	NULL
+3002	NULL	(p3000-299999-)subp12	NULL
+3003	NULL	(p3000-299999-)subp12	NULL
+3004	NULL	(p3000-299999-)subp12	NULL
+301	NULL	(p300-2999-)subp8	NULL
+302	NULL	(p300-2999-)subp8	NULL
+303	NULL	(p300-2999-)subp8	NULL
+304	NULL	(p300-2999-)subp8	NULL
+31	NULL	(p30-299-)subp6	NULL
+32	NULL	(p30-299-)subp6	NULL
+33	NULL	(p30-299-)subp6	NULL
+34	NULL	(p30-299-)subp6	NULL
+4	4	(p0-29-)subp3	(p0-29-)subp3
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+RIGHT JOIN
+t2 
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+24	24	(p0-29-)subp5	(p0-29-)subp5
+3	3	(p0-29-)subp3	(p0-29-)subp3
+4	4	(p0-29-)subp3	(p0-29-)subp3
+NULL	-1	NULL	(pNeg-)subp0
+NULL	-2	NULL	(pNeg-)subp0
+NULL	-3	NULL	(pNeg-)subp0
+NULL	-4	NULL	(pNeg-)subp0
+NULL	299996	NULL	(p3000-299999-)subp14
+NULL	299997	NULL	(p3000-299999-)subp14
+NULL	299998	NULL	(p3000-299999-)subp14
+NULL	299999	NULL	(p3000-299999-)subp14
+NULL	3001	NULL	(p3000-299999-)subp12
+NULL	3002	NULL	(p3000-299999-)subp12
+NULL	3003	NULL	(p3000-299999-)subp12
+NULL	3004	NULL	(p3000-299999-)subp12
+NULL	301	NULL	(p300-2999-)subp8
+NULL	302	NULL	(p300-2999-)subp8
+NULL	303	NULL	(p300-2999-)subp8
+NULL	304	NULL	(p300-2999-)subp8
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 
+RIGHT JOIN
+t2 PARTITION (`p0-29`,`p30-299`) 
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+24	24	(p0-29-)subp5	(p0-29-)subp5
+3	3	(p0-29-)subp3	(p0-29-)subp3
+4	4	(p0-29-)subp3	(p0-29-)subp3
+DELETE FROM t1 PARTITION (`p0-29`);
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+INSERT INTO t1 VALUES (1,'t1-p0-29-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	t1-p0-29-ins
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+INSERT INTO t2 VALUES (32,'t2-p30-299-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	t1-p0-29-ins
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+32	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+1	32	t1-p0-29-ins	t2-p30-299-ins
+DELETE FROM t1 PARTITION (`p30-299`);
+INSERT INTO t1 VALUES (31,'t1-p30-299-ins');
+DELETE FROM t2 PARTITION (`p0-29`);
+INSERT INTO t2 VALUES (2,'t2-p0-29-ins');
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	t1-p0-29-ins
+31	t1-p30-299-ins
+SELECT * FROM t2  PARTITION (`p0-29`,`p30-299`);
+a	b
+2	t2-p0-29-ins
+32	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`,`p30-299`), 
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	2	t1-p0-29-ins	t2-p0-29-ins
+1	32	t1-p0-29-ins	t2-p30-299-ins
+31	2	t1-p30-299-ins	t2-p0-29-ins
+31	32	t1-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	2	t1-p0-29-ins	t2-p0-29-ins
+1	32	t1-p0-29-ins	t2-p30-299-ins
+31	2	t1-p30-299-ins	t2-p0-29-ins
+31	32	t1-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	2	t1-p0-29-ins	t2-p0-29-ins
+1	32	t1-p0-29-ins	t2-p30-299-ins
+31	2	t1-p30-299-ins	t2-p0-29-ins
+31	32	t1-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+NATURAL JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+LEFT JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	NULL	t1-p0-29-ins	NULL
+31	NULL	t1-p30-299-ins	NULL
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+RIGHT JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+NULL	2	NULL	t2-p0-29-ins
+NULL	32	NULL	t2-p30-299-ins
+INSERT INTO t1 VALUES (32,'t2-p30-299-ins');
+INSERT INTO t2 VALUES (1,'t1-p0-29-ins');
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	t1-p0-29-ins	t1-p0-29-ins
+32	32	t2-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+NATURAL JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	1	t1-p0-29-ins	t1-p0-29-ins
+32	32	t2-p30-299-ins	t2-p30-299-ins
+disconnect session1;
+connection default;
+DROP VIEW v1;
+DROP TABLE t1, t2;
+DROP USER test_user_1;

=== added file 'mysql-test/suite/parts/r/partition-dml-1-9-myisam.result'
--- a/mysql-test/suite/parts/r/partition-dml-1-9-myisam.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition-dml-1-9-myisam.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,545 @@
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+CREATE TABLE t2 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t2 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t2 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
+connect  session1, localhost, test_user_1,'testpw',test;
+CREATE VIEW v1 AS
+SELECT t1.a, t2.b FROM t1 PARTITION (`p0-29`), t2 
+WHERE t1.a = t2.a;
+SELECT * FROM v1;
+a	b
+-4	(pNeg-)subp0
+-3	(pNeg-)subp0
+-2	(pNeg-)subp0
+-1	(pNeg-)subp0
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+301	(p300-2999-)subp8
+302	(p300-2999-)subp8
+303	(p300-2999-)subp8
+304	(p300-2999-)subp8
+3001	(p3000-299999-)subp12
+3002	(p3000-299999-)subp12
+3003	(p3000-299999-)subp12
+3004	(p3000-299999-)subp12
+299996	(p3000-299999-)subp14
+299997	(p3000-299999-)subp14
+299998	(p3000-299999-)subp14
+299999	(p3000-299999-)subp14
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+SELECT * FROM t2 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	(p30-299-)subp6
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+34	(p30-299-)subp6
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+1	231	(p0-29-)subp3	(p30-299-)subp8
+1	232	(p0-29-)subp3	(p30-299-)subp8
+1	233	(p0-29-)subp3	(p30-299-)subp8
+1	234	(p0-29-)subp3	(p30-299-)subp8
+1	31	(p0-29-)subp3	(p30-299-)subp6
+1	32	(p0-29-)subp3	(p30-299-)subp6
+1	33	(p0-29-)subp3	(p30-299-)subp6
+1	34	(p0-29-)subp3	(p30-299-)subp6
+2	231	(p0-29-)subp3	(p30-299-)subp8
+2	232	(p0-29-)subp3	(p30-299-)subp8
+2	233	(p0-29-)subp3	(p30-299-)subp8
+2	234	(p0-29-)subp3	(p30-299-)subp8
+2	31	(p0-29-)subp3	(p30-299-)subp6
+2	32	(p0-29-)subp3	(p30-299-)subp6
+2	33	(p0-29-)subp3	(p30-299-)subp6
+2	34	(p0-29-)subp3	(p30-299-)subp6
+21	231	(p0-29-)subp5	(p30-299-)subp8
+21	232	(p0-29-)subp5	(p30-299-)subp8
+21	233	(p0-29-)subp5	(p30-299-)subp8
+21	234	(p0-29-)subp5	(p30-299-)subp8
+21	31	(p0-29-)subp5	(p30-299-)subp6
+21	32	(p0-29-)subp5	(p30-299-)subp6
+21	33	(p0-29-)subp5	(p30-299-)subp6
+21	34	(p0-29-)subp5	(p30-299-)subp6
+22	231	(p0-29-)subp5	(p30-299-)subp8
+22	232	(p0-29-)subp5	(p30-299-)subp8
+22	233	(p0-29-)subp5	(p30-299-)subp8
+22	234	(p0-29-)subp5	(p30-299-)subp8
+22	31	(p0-29-)subp5	(p30-299-)subp6
+22	32	(p0-29-)subp5	(p30-299-)subp6
+22	33	(p0-29-)subp5	(p30-299-)subp6
+22	34	(p0-29-)subp5	(p30-299-)subp6
+23	231	(p0-29-)subp5	(p30-299-)subp8
+23	232	(p0-29-)subp5	(p30-299-)subp8
+23	233	(p0-29-)subp5	(p30-299-)subp8
+23	234	(p0-29-)subp5	(p30-299-)subp8
+23	31	(p0-29-)subp5	(p30-299-)subp6
+23	32	(p0-29-)subp5	(p30-299-)subp6
+23	33	(p0-29-)subp5	(p30-299-)subp6
+23	34	(p0-29-)subp5	(p30-299-)subp6
+24	231	(p0-29-)subp5	(p30-299-)subp8
+24	232	(p0-29-)subp5	(p30-299-)subp8
+24	233	(p0-29-)subp5	(p30-299-)subp8
+24	234	(p0-29-)subp5	(p30-299-)subp8
+24	31	(p0-29-)subp5	(p30-299-)subp6
+24	32	(p0-29-)subp5	(p30-299-)subp6
+24	33	(p0-29-)subp5	(p30-299-)subp6
+24	34	(p0-29-)subp5	(p30-299-)subp6
+3	231	(p0-29-)subp3	(p30-299-)subp8
+3	232	(p0-29-)subp3	(p30-299-)subp8
+3	233	(p0-29-)subp3	(p30-299-)subp8
+3	234	(p0-29-)subp3	(p30-299-)subp8
+3	31	(p0-29-)subp3	(p30-299-)subp6
+3	32	(p0-29-)subp3	(p30-299-)subp6
+3	33	(p0-29-)subp3	(p30-299-)subp6
+3	34	(p0-29-)subp3	(p30-299-)subp6
+4	231	(p0-29-)subp3	(p30-299-)subp8
+4	232	(p0-29-)subp3	(p30-299-)subp8
+4	233	(p0-29-)subp3	(p30-299-)subp8
+4	234	(p0-29-)subp3	(p30-299-)subp8
+4	31	(p0-29-)subp3	(p30-299-)subp6
+4	32	(p0-29-)subp3	(p30-299-)subp6
+4	33	(p0-29-)subp3	(p30-299-)subp6
+4	34	(p0-29-)subp3	(p30-299-)subp6
+SELECT * FROM t1 PARTITION (subp3);
+a	b
+21	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+SELECT * FROM t2 PARTITION (subp6);
+a	b
+231	(p30-299-)subp8
+234	(p30-299-)subp8
+33	(p30-299-)subp6
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (subp3), 
+t2 PARTITION (subp6);
+t1a	t2a	t1b	t2b
+21	231	(p0-29-)subp5	(p30-299-)subp8
+21	234	(p0-29-)subp5	(p30-299-)subp8
+21	33	(p0-29-)subp5	(p30-299-)subp6
+24	231	(p0-29-)subp5	(p30-299-)subp8
+24	234	(p0-29-)subp5	(p30-299-)subp8
+24	33	(p0-29-)subp5	(p30-299-)subp6
+3	231	(p0-29-)subp3	(p30-299-)subp8
+3	234	(p0-29-)subp3	(p30-299-)subp8
+3	33	(p0-29-)subp3	(p30-299-)subp6
+SELECT * FROM t1 PARTITION (subp3,subp5);
+a	b
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+SELECT * FROM t2 PARTITION (subp6,subp8);
+a	b
+231	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+32	(p30-299-)subp6
+33	(p30-299-)subp6
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (subp3,subp5), 
+t2 PARTITION (subp6,subp8);
+t1a	t2a	t1b	t2b
+2	231	(p0-29-)subp3	(p30-299-)subp8
+2	233	(p0-29-)subp3	(p30-299-)subp8
+2	234	(p0-29-)subp3	(p30-299-)subp8
+2	32	(p0-29-)subp3	(p30-299-)subp6
+2	33	(p0-29-)subp3	(p30-299-)subp6
+21	231	(p0-29-)subp5	(p30-299-)subp8
+21	233	(p0-29-)subp5	(p30-299-)subp8
+21	234	(p0-29-)subp5	(p30-299-)subp8
+21	32	(p0-29-)subp5	(p30-299-)subp6
+21	33	(p0-29-)subp5	(p30-299-)subp6
+23	231	(p0-29-)subp5	(p30-299-)subp8
+23	233	(p0-29-)subp5	(p30-299-)subp8
+23	234	(p0-29-)subp5	(p30-299-)subp8
+23	32	(p0-29-)subp5	(p30-299-)subp6
+23	33	(p0-29-)subp5	(p30-299-)subp6
+24	231	(p0-29-)subp5	(p30-299-)subp8
+24	233	(p0-29-)subp5	(p30-299-)subp8
+24	234	(p0-29-)subp5	(p30-299-)subp8
+24	32	(p0-29-)subp5	(p30-299-)subp6
+24	33	(p0-29-)subp5	(p30-299-)subp6
+3	231	(p0-29-)subp3	(p30-299-)subp8
+3	233	(p0-29-)subp3	(p30-299-)subp8
+3	234	(p0-29-)subp3	(p30-299-)subp8
+3	32	(p0-29-)subp3	(p30-299-)subp6
+3	33	(p0-29-)subp3	(p30-299-)subp6
+DELETE FROM t2 PARTITION (`p30-299`);
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+LEFT JOIN
+t2 
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+231	NULL	(p30-299-)subp8	NULL
+232	NULL	(p30-299-)subp8	NULL
+233	NULL	(p30-299-)subp8	NULL
+234	NULL	(p30-299-)subp8	NULL
+24	24	(p0-29-)subp5	(p0-29-)subp5
+3	3	(p0-29-)subp3	(p0-29-)subp3
+31	NULL	(p30-299-)subp6	NULL
+32	NULL	(p30-299-)subp6	NULL
+33	NULL	(p30-299-)subp6	NULL
+34	NULL	(p30-299-)subp6	NULL
+4	4	(p0-29-)subp3	(p0-29-)subp3
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 
+LEFT JOIN
+t2 PARTITION (`p0-29`,`p30-299`) 
+USING (a,b);
+t1a	t2a	t1b	t2b
+-1	NULL	(pNeg-)subp0	NULL
+-2	NULL	(pNeg-)subp0	NULL
+-3	NULL	(pNeg-)subp0	NULL
+-4	NULL	(pNeg-)subp0	NULL
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+231	NULL	(p30-299-)subp8	NULL
+232	NULL	(p30-299-)subp8	NULL
+233	NULL	(p30-299-)subp8	NULL
+234	NULL	(p30-299-)subp8	NULL
+24	24	(p0-29-)subp5	(p0-29-)subp5
+299996	NULL	(p3000-299999-)subp14	NULL
+299997	NULL	(p3000-299999-)subp14	NULL
+299998	NULL	(p3000-299999-)subp14	NULL
+299999	NULL	(p3000-299999-)subp14	NULL
+3	3	(p0-29-)subp3	(p0-29-)subp3
+3001	NULL	(p3000-299999-)subp12	NULL
+3002	NULL	(p3000-299999-)subp12	NULL
+3003	NULL	(p3000-299999-)subp12	NULL
+3004	NULL	(p3000-299999-)subp12	NULL
+301	NULL	(p300-2999-)subp8	NULL
+302	NULL	(p300-2999-)subp8	NULL
+303	NULL	(p300-2999-)subp8	NULL
+304	NULL	(p300-2999-)subp8	NULL
+31	NULL	(p30-299-)subp6	NULL
+32	NULL	(p30-299-)subp6	NULL
+33	NULL	(p30-299-)subp6	NULL
+34	NULL	(p30-299-)subp6	NULL
+4	4	(p0-29-)subp3	(p0-29-)subp3
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+RIGHT JOIN
+t2 
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+24	24	(p0-29-)subp5	(p0-29-)subp5
+3	3	(p0-29-)subp3	(p0-29-)subp3
+4	4	(p0-29-)subp3	(p0-29-)subp3
+NULL	-1	NULL	(pNeg-)subp0
+NULL	-2	NULL	(pNeg-)subp0
+NULL	-3	NULL	(pNeg-)subp0
+NULL	-4	NULL	(pNeg-)subp0
+NULL	299996	NULL	(p3000-299999-)subp14
+NULL	299997	NULL	(p3000-299999-)subp14
+NULL	299998	NULL	(p3000-299999-)subp14
+NULL	299999	NULL	(p3000-299999-)subp14
+NULL	3001	NULL	(p3000-299999-)subp12
+NULL	3002	NULL	(p3000-299999-)subp12
+NULL	3003	NULL	(p3000-299999-)subp12
+NULL	3004	NULL	(p3000-299999-)subp12
+NULL	301	NULL	(p300-2999-)subp8
+NULL	302	NULL	(p300-2999-)subp8
+NULL	303	NULL	(p300-2999-)subp8
+NULL	304	NULL	(p300-2999-)subp8
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 
+RIGHT JOIN
+t2 PARTITION (`p0-29`,`p30-299`) 
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	(p0-29-)subp3	(p0-29-)subp3
+2	2	(p0-29-)subp3	(p0-29-)subp3
+21	21	(p0-29-)subp5	(p0-29-)subp5
+22	22	(p0-29-)subp5	(p0-29-)subp5
+23	23	(p0-29-)subp5	(p0-29-)subp5
+24	24	(p0-29-)subp5	(p0-29-)subp5
+3	3	(p0-29-)subp3	(p0-29-)subp3
+4	4	(p0-29-)subp3	(p0-29-)subp3
+DELETE FROM t1 PARTITION (`p0-29`);
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+INSERT INTO t1 VALUES (1,'t1-p0-29-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	t1-p0-29-ins
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+INSERT INTO t2 VALUES (32,'t2-p30-299-ins');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	t1-p0-29-ins
+SELECT * FROM t2  PARTITION (`p30-299`);
+a	b
+32	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`), 
+t2 PARTITION (`p30-299`);
+t1a	t2a	t1b	t2b
+1	32	t1-p0-29-ins	t2-p30-299-ins
+DELETE FROM t1 PARTITION (`p30-299`);
+INSERT INTO t1 VALUES (31,'t1-p30-299-ins');
+DELETE FROM t2 PARTITION (`p0-29`);
+INSERT INTO t2 VALUES (2,'t2-p0-29-ins');
+SELECT * FROM t1 PARTITION (`p0-29`,`p30-299`);
+a	b
+1	t1-p0-29-ins
+31	t1-p30-299-ins
+SELECT * FROM t2  PARTITION (`p0-29`,`p30-299`);
+a	b
+2	t2-p0-29-ins
+32	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM t1 PARTITION (`p0-29`,`p30-299`), 
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	2	t1-p0-29-ins	t2-p0-29-ins
+1	32	t1-p0-29-ins	t2-p30-299-ins
+31	2	t1-p30-299-ins	t2-p0-29-ins
+31	32	t1-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	2	t1-p0-29-ins	t2-p0-29-ins
+1	32	t1-p0-29-ins	t2-p30-299-ins
+31	2	t1-p30-299-ins	t2-p0-29-ins
+31	32	t1-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	2	t1-p0-29-ins	t2-p0-29-ins
+1	32	t1-p0-29-ins	t2-p30-299-ins
+31	2	t1-p30-299-ins	t2-p0-29-ins
+31	32	t1-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+NATURAL JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+LEFT JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	NULL	t1-p0-29-ins	NULL
+31	NULL	t1-p30-299-ins	NULL
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+RIGHT JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+NULL	2	NULL	t2-p0-29-ins
+NULL	32	NULL	t2-p30-299-ins
+INSERT INTO t1 VALUES (32,'t2-p30-299-ins');
+INSERT INTO t2 VALUES (1,'t1-p0-29-ins');
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+INNER JOIN
+t2 PARTITION (`p0-29`,`p30-299`)
+USING (a,b);
+t1a	t2a	t1b	t2b
+1	1	t1-p0-29-ins	t1-p0-29-ins
+32	32	t2-p30-299-ins	t2-p30-299-ins
+SELECT t1.a AS t1a,t2.a AS t2a,t1.b AS t1b,t2.b AS t2b FROM 
+t1 PARTITION (`p0-29`,`p30-299`) 
+NATURAL JOIN
+t2 PARTITION (`p0-29`,`p30-299`);
+t1a	t2a	t1b	t2b
+1	1	t1-p0-29-ins	t1-p0-29-ins
+32	32	t2-p30-299-ins	t2-p30-299-ins
+disconnect session1;
+connection default;
+DROP VIEW v1;
+DROP TABLE t1, t2;
+DROP USER test_user_1;

=== added file 'mysql-test/suite/parts/r/rpl-partition-dml-1-1-innodb.result'
--- a/mysql-test/suite/parts/r/rpl-partition-dml-1-1-innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/rpl-partition-dml-1-1-innodb.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,217 @@
+include/master-slave.inc
+[connection master]
+set @old_global_binlog_format=  @@global.binlog_format;
+set @old_session_binlog_format=  @@session.binlog_format;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format	@@session.binlog_format
+ROW	ROW
+[on slave]
+set @old_global_binlog_format=  @@global.binlog_format;
+set @old_session_binlog_format=  @@session.binlog_format;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format	@@session.binlog_format
+ROW	ROW
+include/stop_slave.inc
+include/start_slave.inc
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection master;
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+connection master;
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+connection master;
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+set @@global.binlog_format=  @old_global_binlog_format;
+set @@session.binlog_format=  @old_session_binlog_format;
+connection master;
+set @@global.binlog_format=  @old_global_binlog_format;
+set @@session.binlog_format=  @old_session_binlog_format;
+DROP TABLE t1;
+include/rpl_end.inc
+connection server_2;
+connection server_2;
+connection server_2;
+connection server_2;
+connection server_1;
+connection server_1;
+connection server_1;
+connection server_2;
+connection server_1;
+connection server_2;
+connection server_2;
+connection server_1;
+connection server_1;
+connection server_1;
+connection default;
+disconnect server_2;
+disconnect server_2_1;
+disconnect server_1;
+disconnect server_1_1;

=== added file 'mysql-test/suite/parts/r/rpl-partition-dml-1-1-myisam.result'
--- a/mysql-test/suite/parts/r/rpl-partition-dml-1-1-myisam.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/rpl-partition-dml-1-1-myisam.result	2011-02-17 15:36:05 +0000
@@ -0,0 +1,217 @@
+include/master-slave.inc
+[connection master]
+set @old_global_binlog_format=  @@global.binlog_format;
+set @old_session_binlog_format=  @@session.binlog_format;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format	@@session.binlog_format
+ROW	ROW
+[on slave]
+set @old_global_binlog_format=  @@global.binlog_format;
+set @old_session_binlog_format=  @@session.binlog_format;
+SET GLOBAL binlog_format = 'ROW';
+SET SESSION binlog_format = 'ROW';
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format	@@session.binlog_format
+ROW	ROW
+include/stop_slave.inc
+include/start_slave.inc
+# Additional tests for WL#5217 by QA, testplan 1.1
+CREATE TABLE t1 
+(a INT NOT NULL,
+b varchar (64),
+INDEX ind_t1 (b,a),
+PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a) SUBPARTITIONS 3
+(PARTITION pNeg VALUES LESS THAN (0)
+(SUBPARTITION subp0  ,
+SUBPARTITION subp1  ,
+SUBPARTITION subp2  ),
+PARTITION `p0-29` VALUES LESS THAN (30)
+(SUBPARTITION subp3  ,
+SUBPARTITION subp4  ,
+SUBPARTITION subp5  ),
+PARTITION `p30-299` VALUES LESS THAN (300)
+(SUBPARTITION subp6  ,
+SUBPARTITION subp7  ,
+SUBPARTITION subp8  ),
+PARTITION `p300-2999` VALUES LESS THAN (3000)
+(SUBPARTITION subp9  ,
+SUBPARTITION subp10  ,
+SUBPARTITION subp11  ),
+PARTITION `p3000-299999` VALUES LESS THAN (300000)
+(SUBPARTITION subp12  ,
+SUBPARTITION subp13  ,
+SUBPARTITION subp14  ));
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-4, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-3, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-2, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (pNeg, subp0) VALUES (-1, '(pNeg-)subp0');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (4, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (3, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (2, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp3) VALUES (1, '(p0-29-)subp3');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (24, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (23, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (22, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p0-29`, subp5) VALUES (21, '(p0-29-)subp5');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (34, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (33, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (32, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp9) VALUES (31, '(p30-299-)subp6');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (234, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (233, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (232, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p30-299`, subp8) VALUES (231, '(p30-299-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (304, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (303, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (302, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p300-2999`, subp8) VALUES (301, '(p300-2999-)subp8');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3004, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3003, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3002, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp12) VALUES (3001, '(p3000-299999-)subp12');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299996, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299997, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299998, '(p3000-299999-)subp14');
+INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	(p0-29-)subp3
+2	(p0-29-)subp3
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	(p0-29-)subp3
+4	(p0-29-)subp3
+UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (`p0-29`);
+a	b
+1	p0-29-upd-1
+2	p0-29-upd-1
+21	(p0-29-)subp5
+22	(p0-29-)subp5
+23	(p0-29-)subp5
+24	(p0-29-)subp5
+3	p0-29-upd-1
+4	p0-29-upd-1
+connection master;
+UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (`p30-299`);
+a	b
+231	(p30-299-)subp8
+232	(p30-299-)subp8
+233	(p30-299-)subp8
+234	(p30-299-)subp8
+31	p30-299-upd
+32	p30-299-upd
+33	p30-299-upd
+34	p30-299-upd
+connection master;
+UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (`p300-2999`);
+a	b
+301	p300-2999-upd
+302	p300-2999-upd
+303	p300-2999-upd
+304	p300-2999-upd
+connection master;
+UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
+UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
+UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+connection slave;
+include/check_slave_is_running.inc
+connection slave;
+connection slave;
+connection slave;
+SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
+a	b
+1	subp4-upd
+2	subp5-upd
+21	subp3-upd
+22	subp4-upd
+23	subp5-upd
+24	subp3-upd
+3	subp3-upd
+4	subp4-upd
+set @@global.binlog_format=  @old_global_binlog_format;
+set @@session.binlog_format=  @old_session_binlog_format;
+connection master;
+set @@global.binlog_format=  @old_global_binlog_format;
+set @@session.binlog_format=  @old_session_binlog_format;
+DROP TABLE t1;
+include/rpl_end.inc
+connection server_2;
+connection server_2;
+connection server_2;
+connection server_2;
+connection server_1;
+connection server_1;
+connection server_1;
+connection server_2;
+connection server_1;
+connection server_2;
+connection server_2;
+connection server_1;
+connection server_1;
+connection server_1;
+connection default;
+disconnect server_2;
+disconnect server_2_1;
+disconnect server_1;
+disconnect server_1_1;

=== added file 'mysql-test/suite/parts/t/partition-dml-1-1-innodb-modes.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-1-innodb-modes.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-1-innodb-modes.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,10 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+set @save_sqlmode= @@global.sql_mode;
+let $ENGINE=InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-1-modes.inc
+set @@global.sql_mode= @save_sqlmode;
+

=== added file 'mysql-test/suite/parts/t/partition-dml-1-1-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-1-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-1-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,8 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-1.inc
+

=== added file 'mysql-test/suite/parts/t/partition-dml-1-1-myisam-modes.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-1-myisam-modes.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-1-myisam-modes.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,9 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+set @save_sqlmode= @@global.sql_mode;
+let $ENGINE=MyISAM;
+--source suite/parts/inc/partition-dml-1-1-modes.inc
+set @@global.sql_mode= @save_sqlmode;
+

=== added file 'mysql-test/suite/parts/t/partition-dml-1-1-myisam.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-1-myisam.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-1-myisam.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,7 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=MyISAM;
+--source suite/parts/inc/partition-dml-1-1.inc
+

=== added file 'mysql-test/suite/parts/t/partition-dml-1-10-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-10-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-10-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-10.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-10-myisam.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-10-myisam.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-10-myisam.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,2 @@
+let $engine= MyISAM;
+--source suite/parts/inc/partition-dml-1-10.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-11-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-11-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-11-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,8 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-11.inc
+

=== added file 'mysql-test/suite/parts/t/partition-dml-1-11-myisam.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-11-myisam.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-11-myisam.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,7 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=MyISAM;
+--source suite/parts/inc/partition-dml-1-11.inc
+

=== added file 'mysql-test/suite/parts/t/partition-dml-1-2-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-2-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-2-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-2.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-2-myisam.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-2-myisam.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-2-myisam.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,2 @@
+let $engine= MyISAM;
+--source suite/parts/inc/partition-dml-1-2.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-3-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-3-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-3-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-3.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-4-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-4-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-4-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-4.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-5-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-5-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-5-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-5.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-6-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-6-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-6-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-6.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-7-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-7-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-7-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-7.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-8-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-8-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-8-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,3 @@
+let $engine= InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-8.inc

=== added file 'mysql-test/suite/parts/t/partition-dml-1-9-innodb.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-9-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-9-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,8 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/partition-dml-1-9.inc
+

=== added file 'mysql-test/suite/parts/t/partition-dml-1-9-myisam.test'
--- a/mysql-test/suite/parts/t/partition-dml-1-9-myisam.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition-dml-1-9-myisam.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,7 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=MyISAM;
+--source suite/parts/inc/partition-dml-1-9.inc
+

=== added file 'mysql-test/suite/parts/t/rpl-partition-dml-1-1-innodb.test'
--- a/mysql-test/suite/parts/t/rpl-partition-dml-1-1-innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/rpl-partition-dml-1-1-innodb.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,9 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=InnoDB;
+--source include/have_innodb.inc
+--source suite/parts/inc/rpl-partition-dml-1-1.inc
+--source include/rpl_end.inc
+

=== added file 'mysql-test/suite/parts/t/rpl-partition-dml-1-1-myisam.test'
--- a/mysql-test/suite/parts/t/rpl-partition-dml-1-1-myisam.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/rpl-partition-dml-1-1-myisam.test	2011-02-17 15:36:05 +0000
@@ -0,0 +1,7 @@
+# Test of explicit partition selection in dml statements (wl5217)
+# Creation date: 01-07-10
+# Author: Horst Hunger
+
+let $ENGINE=MyISAM;
+--source suite/parts/inc/rpl-partition-dml-1-1.inc
+--source include/rpl_end.inc


Attachment: [text/bzr-bundle] bzr/horst.hunger@sun.com-20110217153605-az41gre7it89aq1f.bundle
Thread
bzr commit into mysql-trunk branch (horst.hunger:3572) WL#5217Horst.Hunger17 Feb