List:Commits« Previous MessageNext Message »
From:Horst.Hunger Date:February 17 2011 4:05pm
Subject:bzr push into mysql-trunk branch (horst.hunger:3573)
View as plain text  
 3573 Horst.Hunger	2011-02-17 [merge]
      due to merge.

    removed:
      mysql-test/collections/mysql-5.1-innodb.push
      mysql-test/collections/mysql-5.5-innodb.push
      mysql-test/collections/mysql-next-mr-wl2540.push
      mysql-test/collections/mysql-trunk-innodb.push
      mysql-test/collections/mysql-trunk.daily
      mysql-test/collections/mysql-trunk.push
      mysql-test/collections/mysql-trunk.weekly
      mysql-test/collections/test-bt
      mysql-test/collections/test-bt-debug
      mysql-test/collections/test-bt-debug-fast
      mysql-test/collections/test-bt-fast
      mysql-test/suite/perfschema/r/debug_env.result
      mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result
      mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result
      mysql-test/suite/perfschema/t/debug_env.test
      mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test
      mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test
      storage/perfschema/unittest/stub_server_misc.h.moved
    added:
      include/mysql/service_my_plugin_log.h
      libservices/my_plugin_log_service.c
      mysql-test/collections/default.release
      mysql-test/collections/disabled-daily.list
      mysql-test/extra/rpl_tests/rpl_insert_duplicate.test
      mysql-test/include/have_dbi_dbd-mysql.inc
      mysql-test/r/ssl_and_innodb.result
      mysql-test/std_data/checkDBI_DBD-mysql.pl
      mysql-test/suite/innodb/r/innodb-autoinc-56228.result
      mysql-test/suite/innodb/r/innodb_bug30423.result
      mysql-test/suite/innodb/t/innodb-autoinc-56228-master.opt
      mysql-test/suite/innodb/t/innodb-autoinc-56228.test
      mysql-test/suite/innodb/t/innodb_bug30423.test
      mysql-test/suite/perfschema/r/all_tests.result
      mysql-test/suite/perfschema/r/ddl_threads.result
      mysql-test/suite/perfschema/r/dml_fs_by_event_name.result
      mysql-test/suite/perfschema/r/dml_fs_by_instance.result
      mysql-test/suite/perfschema/t/all_tests.test
      mysql-test/suite/perfschema/t/ddl_threads.test
      mysql-test/suite/perfschema/t/dml_fs_by_event_name.test
      mysql-test/suite/perfschema/t/dml_fs_by_instance.test
      mysql-test/suite/rpl/r/rpl_insert_duplicate.result
      mysql-test/suite/rpl/t/rpl_insert_duplicate.test
      mysql-test/suite/sys_vars/r/secure_file_priv2.result
      mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt
      mysql-test/suite/sys_vars/t/secure_file_priv2.test
      mysql-test/t/ssl_and_innodb.test
      unittest/gunit/item-t.cc
    modified:
      .bzrignore
      BUILD/SETUP.sh
      BUILD/build_mccge.sh
      README
      client/my_readline.h
      client/mysql.cc
      client/readline.cc
      cmake/cpack_source_ignore_files.cmake
      config.h.cmake
      configure.cmake
      include/my_base.h
      include/my_global.h
      include/my_pthread.h
      include/my_sys.h
      include/my_time.h
      include/mysql/plugin.h
      include/mysql/plugin_audit.h.pp
      include/mysql/plugin_auth.h.pp
      include/mysql/plugin_ftparser.h.pp
      include/mysql/services.h
      include/service_versions.h
      include/welcome_copyright_notice.h
      libmysqld/CMakeLists.txt
      libservices/CMakeLists.txt
      mysql-test/CMakeLists.txt
      mysql-test/collections/default.daily
      mysql-test/collections/default.experimental
      mysql-test/collections/default.push
      mysql-test/collections/default.weekly
      mysql-test/extra/rpl_tests/rpl_insert_ignore.test
      mysql-test/include/commit.inc
      mysql-test/include/ctype_numconv.inc
      mysql-test/include/gis_keys.inc
      mysql-test/include/icp_tests.inc
      mysql-test/include/mtr_warnings.sql
      mysql-test/include/mysqlhotcopy.inc
      mysql-test/include/order_by.inc
      mysql-test/include/plugin.defs
      mysql-test/include/range.inc
      mysql-test/include/rpl_sync.inc
      mysql-test/include/subquery.inc
      mysql-test/include/subquery_sj.inc
      mysql-test/include/subquery_sj_innodb.inc
      mysql-test/lib/My/SafeProcess.pm
      mysql-test/lib/My/SafeProcess/safe_process.cc
      mysql-test/lib/My/SafeProcess/safe_process_win.cc
      mysql-test/mysql-test-run.pl
      mysql-test/r/commit_1innodb.result
      mysql-test/r/csv_not_null.result
      mysql-test/r/ctype_binary.result
      mysql-test/r/ctype_cp1251.result
      mysql-test/r/ctype_latin1.result
      mysql-test/r/ctype_ucs.result
      mysql-test/r/ctype_utf8.result
      mysql-test/r/delete.result
      mysql-test/r/filesort_debug.result
      mysql-test/r/func_in_all.result
      mysql-test/r/func_time.result
      mysql-test/r/gis.result
      mysql-test/r/grant.result
      mysql-test/r/innodb_icp.result
      mysql-test/r/innodb_icp_all.result
      mysql-test/r/innodb_icp_none.result
      mysql-test/r/join_outer.result
      mysql-test/r/join_outer_jcl6.result
      mysql-test/r/myisam_icp.result
      mysql-test/r/myisam_icp_all.result
      mysql-test/r/myisam_icp_none.result
      mysql-test/r/not_embedded_server.result
      mysql-test/r/optimizer_switch.result
      mysql-test/r/order_by_all.result
      mysql-test/r/order_by_icp_mrr.result
      mysql-test/r/order_by_none.result
      mysql-test/r/plugin_auth.result
      mysql-test/r/plugin_auth_qa_1.result
      mysql-test/r/range_all.result
      mysql-test/r/range_icp.result
      mysql-test/r/range_icp_mrr.result
      mysql-test/r/range_mrr.result
      mysql-test/r/range_mrr_cost.result
      mysql-test/r/range_none.result
      mysql-test/r/subquery_all.result
      mysql-test/r/subquery_all_jcl6.result
      mysql-test/r/subquery_nomat_nosj.result
      mysql-test/r/subquery_nomat_nosj_jcl6.result
      mysql-test/r/subquery_none.result
      mysql-test/r/subquery_none_jcl6.result
      mysql-test/r/subquery_sj_all.result
      mysql-test/r/subquery_sj_all_jcl6.result
      mysql-test/r/subquery_sj_all_jcl7.result
      mysql-test/r/subquery_sj_dupsweed.result
      mysql-test/r/subquery_sj_dupsweed_jcl6.result
      mysql-test/r/subquery_sj_dupsweed_jcl7.result
      mysql-test/r/subquery_sj_firstmatch.result
      mysql-test/r/subquery_sj_firstmatch_jcl6.result
      mysql-test/r/subquery_sj_firstmatch_jcl7.result
      mysql-test/r/subquery_sj_innodb_all.result
      mysql-test/r/subquery_sj_innodb_all_jcl6.result
      mysql-test/r/subquery_sj_innodb_all_jcl7.result
      mysql-test/r/subquery_sj_innodb_none.result
      mysql-test/r/subquery_sj_innodb_none_jcl6.result
      mysql-test/r/subquery_sj_innodb_none_jcl7.result
      mysql-test/r/subquery_sj_loosescan.result
      mysql-test/r/subquery_sj_loosescan_jcl6.result
      mysql-test/r/subquery_sj_loosescan_jcl7.result
      mysql-test/r/subquery_sj_mat.result
      mysql-test/r/subquery_sj_mat_jcl6.result
      mysql-test/r/subquery_sj_mat_jcl7.result
      mysql-test/r/subquery_sj_mat_nosj.result
      mysql-test/r/subquery_sj_none.result
      mysql-test/r/subquery_sj_none_jcl6.result
      mysql-test/r/subquery_sj_none_jcl7.result
      mysql-test/r/symlink.result
      mysql-test/r/type_year.result
      mysql-test/r/user_var.result
      mysql-test/r/variables.result
      mysql-test/suite/binlog/r/binlog_unsafe.result
      mysql-test/suite/binlog/t/binlog_unsafe.test
      mysql-test/suite/engines/funcs/r/ps_string_not_null.result
      mysql-test/suite/engines/funcs/t/ps_string_not_null.test
      mysql-test/suite/innodb/r/innodb_gis.result
      mysql-test/suite/innodb/t/innodb_bug56143.test
      mysql-test/suite/parts/inc/partition_fail.inc
      mysql-test/suite/perfschema/include/event_aggregate_setup.inc
      mysql-test/suite/perfschema/r/ortho_iter.result
      mysql-test/suite/perfschema/t/ortho_iter.test
      mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt
      mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt
      mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt
      mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt
      mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt
      mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt
      mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt
      mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt
      mysql-test/suite/perfschema/t/start_server_no_table_hdl-master.opt
      mysql-test/suite/perfschema/t/start_server_no_table_inst-master.opt
      mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt
      mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt
      mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
      mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
      mysql-test/suite/rpl/r/rpl_insert_ignore.result
      mysql-test/suite/rpl/r/rpl_loaddatalocal.result
      mysql-test/suite/rpl/r/rpl_log_pos.result
      mysql-test/suite/rpl/r/rpl_row_event_max_size.result
      mysql-test/suite/rpl/t/disabled.def
      mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
      mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
      mysql-test/suite/rpl/t/rpl_insert_ignore.test
      mysql-test/suite/rpl/t/rpl_loaddatalocal.test
      mysql-test/suite/sys_vars/r/all_vars.result
      mysql-test/t/csv_not_null.test
      mysql-test/t/delete.test
      mysql-test/t/disabled.def
      mysql-test/t/filesort_debug.test
      mysql-test/t/func_time.test
      mysql-test/t/grant.test
      mysql-test/t/join_outer.test
      mysql-test/t/mysql.test
      mysql-test/t/not_embedded_server.test
      mysql-test/t/optimizer_switch.test
      mysql-test/t/partition_binlog.test
      mysql-test/t/plugin_auth.test
      mysql-test/t/plugin_auth_qa_1.test
      mysql-test/t/symlink.test
      mysql-test/t/type_year.test
      mysql-test/t/user_var.test
      mysql-test/t/variables.test
      mysql-test/valgrind.supp
      mysys/charset.c
      mysys/hash.c
      mysys/my_fopen.c
      mysys/my_getsystime.c
      mysys/my_handler.c
      mysys/my_handler_errors.h
      plugin/auth/auth_socket.c
      plugin/auth/test_plugin.c
      regex/my_regex.h
      regex/regcomp.c
      regex/reginit.c
      scripts/mysql_config.pl.in
      scripts/mysql_config.sh
      sql-common/client.c
      sql-common/my_time.c
      sql/CMakeLists.txt
      sql/field.cc
      sql/filesort.cc
      sql/gcalc_slicescan.cc
      sql/gcalc_slicescan.h
      sql/ha_partition.cc
      sql/ha_partition.h
      sql/handler.cc
      sql/handler.h
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_geofunc.h
      sql/item_strfunc.cc
      sql/item_strfunc.h
      sql/item_subselect.h
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/log.cc
      sql/mysqld.cc
      sql/mysqld.h
      sql/net_serv.cc
      sql/opt_range.cc
      sql/partition_info.cc
      sql/partition_info.h
      sql/protocol.cc
      sql/rpl_info_handler.h
      sql/rpl_injector.cc
      sql/rpl_injector.h
      sql/rpl_master.cc
      sql/rpl_slave.cc
      sql/share/errmsg-utf8.txt
      sql/sql_base.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_delete.cc
      sql/sql_insert.cc
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_plugin.cc
      sql/sql_plugin_services.h
      sql/sql_select.cc
      sql/sql_table.cc
      sql/sql_table.h
      sql/sql_view.cc
      sql/sql_yacc.yy
      sql/sys_vars.cc
      sql/table.cc
      sql/table.h
      sql/unireg.h
      storage/innobase/CMakeLists.txt
      storage/innobase/btr/btr0btr.c
      storage/innobase/btr/btr0cur.c
      storage/innobase/btr/btr0sea.c
      storage/innobase/buf/buf0buddy.c
      storage/innobase/buf/buf0buf.c
      storage/innobase/buf/buf0lru.c
      storage/innobase/dict/dict0dict.c
      storage/innobase/dict/dict0load.c
      storage/innobase/dict/dict0stats.c
      storage/innobase/fsp/fsp0fsp.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/handler0alter.cc
      storage/innobase/handler/i_s.cc
      storage/innobase/ibuf/ibuf0ibuf.c
      storage/innobase/include/btr0cur.h
      storage/innobase/include/buf0buf.h
      storage/innobase/include/buf0lru.h
      storage/innobase/include/dict0mem.h
      storage/innobase/include/dict0types.h
      storage/innobase/include/lock0lock.h
      storage/innobase/include/lock0priv.h
      storage/innobase/include/os0sync.h
      storage/innobase/include/os0sync.ic
      storage/innobase/include/os0thread.h
      storage/innobase/include/rem0cmp.h
      storage/innobase/include/rem0cmp.ic
      storage/innobase/include/row0upd.h
      storage/innobase/include/row0vers.h
      storage/innobase/include/srv0srv.h
      storage/innobase/include/sync0rw.h
      storage/innobase/include/sync0sync.h
      storage/innobase/include/trx0roll.h
      storage/innobase/include/trx0rseg.h
      storage/innobase/include/trx0sys.h
      storage/innobase/include/trx0sys.ic
      storage/innobase/include/trx0trx.h
      storage/innobase/include/trx0trx.ic
      storage/innobase/include/trx0types.h
      storage/innobase/include/univ.i
      storage/innobase/include/ut0vec.h
      storage/innobase/include/ut0vec.ic
      storage/innobase/lock/lock0lock.c
      storage/innobase/lock/lock0wait.c
      storage/innobase/mem/mem0mem.c
      storage/innobase/mtr/mtr0log.c
      storage/innobase/page/page0zip.c
      storage/innobase/que/que0que.c
      storage/innobase/read/read0read.c
      storage/innobase/rem/rem0cmp.c
      storage/innobase/row/row0ins.c
      storage/innobase/row/row0merge.c
      storage/innobase/row/row0mysql.c
      storage/innobase/row/row0purge.c
      storage/innobase/row/row0sel.c
      storage/innobase/row/row0umod.c
      storage/innobase/row/row0upd.c
      storage/innobase/row/row0vers.c
      storage/innobase/scripts/persistent_storage.sql
      storage/innobase/srv/srv0srv.c
      storage/innobase/srv/srv0start.c
      storage/innobase/sync/sync0arr.c
      storage/innobase/sync/sync0rw.c
      storage/innobase/sync/sync0sync.c
      storage/innobase/trx/trx0i_s.c
      storage/innobase/trx/trx0purge.c
      storage/innobase/trx/trx0roll.c
      storage/innobase/trx/trx0rseg.c
      storage/innobase/trx/trx0sys.c
      storage/innobase/trx/trx0trx.c
      storage/perfschema/ha_perfschema.cc
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_engine_table.cc
      storage/perfschema/pfs_engine_table.h
      storage/perfschema/pfs_instr.h
      storage/perfschema/pfs_instr_class.cc
      storage/perfschema/pfs_setup_actor.h
      storage/perfschema/pfs_setup_object.h
      storage/perfschema/pfs_stat.h
      storage/perfschema/pfs_timer.h
      storage/perfschema/table_ews_by_thread_by_event_name.cc
      storage/perfschema/table_ews_by_thread_by_event_name.h
      storage/perfschema/table_ews_global_by_event_name.h
      storage/perfschema/table_helper.h
      support-files/mysql.spec.sh
      unittest/gunit/CMakeLists.txt
=== 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-20110217154636-q3ur82znl2hvx9ws.bundle
Thread
bzr push into mysql-trunk branch (horst.hunger:3573) Horst.Hunger17 Feb