List:Commits« Previous MessageNext Message »
From:Sven Sandberg Date:July 28 2008 5:09pm
Subject:bzr commit into mysql-6.0-backup branch (sven:2691)
View as plain text  
#At file:///home/sven/bzr/merge/6.0-rpl-from-5.1-rpl/

 2691 Sven Sandberg	2008-07-28 [merge]
      please ignore - temporary commit
removed:
  mysql-test/include/wait_show_pattern.inc
  mysql-test/include/wait_slave_status.inc
  mysql-test/suite/rpl/data/
  mysql-test/suite/rpl/t/rpl000018-master.opt
  mysql-test/suite/rpl/t/rpl000018-slave.opt
  mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
renamed:
  mysql-test/include/have_federated_db.inc => mysql-test/suite/federated/have_federated_db.inc
  mysql-test/suite/rpl/data/rpl_bug28618.dat => mysql-test/std_data/rpl_bug28618.dat
  mysql-test/suite/rpl/data/rpl_mixed.dat => mysql-test/std_data/rpl_mixed.dat
  mysql-test/suite/rpl_ndb_big/r/rpl_ndb_transaction.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_mixed_engines_transactions.result
  mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_mixed_engines_transactions-master.opt
  mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_mixed_engines_transactions-slave.opt
  mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_mixed_engines_transactions.test
modified:
  .bzrignore
  client/mysqltest.c
  mysql-test/Makefile.am
  mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
  mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
  mysql-test/extra/rpl_tests/rpl_log.test
  mysql-test/include/have_log_bin.inc
  mysql-test/include/master-slave-reset.inc
  mysql-test/include/reset_master_and_slave.inc
  mysql-test/include/wait_for_slave_io_to_stop.inc
  mysql-test/include/wait_for_slave_param.inc
  mysql-test/include/wait_for_slave_sql_error.inc
  mysql-test/include/wait_for_slave_sql_to_start.inc
  mysql-test/include/wait_for_slave_sql_to_stop.inc
  mysql-test/include/wait_for_slave_to_start.inc
  mysql-test/include/wait_for_slave_to_stop.inc
  mysql-test/lib/My/ConfigFactory.pm
  mysql-test/lib/My/Options.pm
  mysql-test/lib/My/SafeProcess.pm
  mysql-test/lib/mtr_cases.pm
  mysql-test/lib/mtr_report.pm
  mysql-test/mysql-test-run.pl*
  mysql-test/r/character_set_database_func.result
  mysql-test/r/func_time.result
  mysql-test/r/grant.result
  mysql-test/r/grant2.result
  mysql-test/r/innodb_max_dirty_pages_pct_func.result
  mysql-test/r/innodb_notembedded.result
  mysql-test/r/loaddata.result
  mysql-test/r/log_bin_trust_function_creators_func.result
  mysql-test/r/mysqlbinlog_base64.result
  mysql-test/r/query_cache.result
  mysql-test/r/query_cache_notembedded.result
  mysql-test/r/rpl_max_binlog_size_func.result
  mysql-test/r/subselect.result
  mysql-test/r/timezone2.result
  mysql-test/r/wait_timeout_func.result
  mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test
  mysql-test/suite/federated/federated_bug_25714.test
  mysql-test/suite/parts/inc/partition_layout_check1.inc
  mysql-test/suite/parts/inc/partition_layout_check2.inc
  mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
  mysql-test/suite/parts/r/partition_alter1_1_myisam.result
  mysql-test/suite/parts/r/partition_alter1_2_myisam.result
  mysql-test/suite/rpl/include/rpl_mixed_dml.inc
  mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
  mysql-test/suite/rpl/r/rpl_flushlog_loop.result
  mysql-test/suite/rpl/r/rpl_found_rows.result
  mysql-test/suite/rpl/r/rpl_init_slave.result
  mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
  mysql-test/suite/rpl/r/rpl_log_pos.result
  mysql-test/suite/rpl/r/rpl_packet.result
  mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
  mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
  mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
  mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
  mysql-test/suite/rpl/r/rpl_row_log.result
  mysql-test/suite/rpl/r/rpl_row_log_innodb.result
  mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
  mysql-test/suite/rpl/r/rpl_row_until.result
  mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
  mysql-test/suite/rpl/r/rpl_slave_skip.result
  mysql-test/suite/rpl/r/rpl_slave_status.result
  mysql-test/suite/rpl/r/rpl_sp.result
  mysql-test/suite/rpl/r/rpl_sp_effects.result
  mysql-test/suite/rpl/r/rpl_stm_log.result
  mysql-test/suite/rpl/r/rpl_stm_until.result
  mysql-test/suite/rpl/r/rpl_variables.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_dual_pos_advance.test
  mysql-test/suite/rpl/t/rpl_flushlog_loop.test
  mysql-test/suite/rpl/t/rpl_idempotency.test
  mysql-test/suite/rpl/t/rpl_incident.test
  mysql-test/suite/rpl/t/rpl_init_slave.test
  mysql-test/suite/rpl/t/rpl_insert.test
  mysql-test/suite/rpl/t/rpl_log_pos.test
  mysql-test/suite/rpl/t/rpl_packet.test
  mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
  mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
  mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
  mysql-test/suite/rpl/t/rpl_row_until.test
  mysql-test/suite/rpl/t/rpl_server_id1.test
  mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
  mysql-test/suite/rpl/t/rpl_slave_skip.test
  mysql-test/suite/rpl/t/rpl_slave_status.test
  mysql-test/suite/rpl/t/rpl_sp.test
  mysql-test/suite/rpl/t/rpl_sp_effects.test
  mysql-test/suite/rpl/t/rpl_stm_until.test
  mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
  mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
  mysql-test/suite/rpl_ndb_big/r/rpl_ndb_log.result
  mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result
  mysql-test/t/character_set_database_func.test
  mysql-test/t/disabled.def
  mysql-test/t/func_time.test
  mysql-test/t/grant.test
  mysql-test/t/grant2.test
  mysql-test/t/innodb_max_dirty_pages_pct_func.test
  mysql-test/t/innodb_notembedded.test
  mysql-test/t/loaddata.test
  mysql-test/t/log_bin_trust_function_creators_func.test
  mysql-test/t/mysqlbinlog_base64.test
  mysql-test/t/query_cache.test
  mysql-test/t/query_cache_notembedded.test
  mysql-test/t/rpl_init_slave_func.test
  mysql-test/t/rpl_max_binlog_size_func.test
  mysql-test/t/subselect.test
  mysql-test/t/timezone2.test
  mysql-test/t/wait_timeout_func.test
  mysql-test/suite/rpl_ndb_big/r/rpl_ndb_mixed_engines_transactions.result
  mysql-test/suite/rpl_ndb_big/t/rpl_ndb_mixed_engines_transactions-master.opt
  mysql-test/suite/rpl_ndb_big/t/rpl_ndb_mixed_engines_transactions.test

=== modified file '.bzrignore'
--- a/.bzrignore	2008-07-22 14:16:22 +0000
+++ b/.bzrignore	2008-07-28 17:08:56 +0000
@@ -545,7 +545,10 @@ libmysqld/ha_myisammrg.cc
 libmysqld/ha_ndbcluster.cc
 libmysqld/ha_ndbcluster_binlog.cc
 libmysqld/ha_ndbcluster_cond.cc
+|<<<<<<< TREE
 libmysqld/ha_ndbcluster_connection.cc
+|=======
+|>>>>>>> MERGE-SOURCE
 libmysqld/ha_partition.cc
 libmysqld/ha_tina.cc
 libmysqld/handler.cc
@@ -1236,11 +1239,17 @@ sql/*.ds?
 sql/*.vcproj
 sql/.gdbinit
 sql/client.c
+|<<<<<<< TREE
 sql/cscope.out
+|=======
+sql/Doxyfile
+|>>>>>>> MERGE-SOURCE
 sql/f.c
 sql/gen_lex_hash
 sql/gmon.out
 sql/handlerton.cc
+sql/html
+sql/latex
 sql/lex_hash.h
 sql/link_sources
 sql/max/*
@@ -1265,6 +1274,7 @@ sql/share/*.sys
 sql/share/fixerrmsg.pl
 sql/share/iso639-2.txt
 sql/share/mysql
+|<<<<<<< TREE
 sql/share/czech/
 sql/share/danish/
 sql/share/dutch/
@@ -1289,6 +1299,10 @@ sql/share/slovak/
 sql/share/spanish/
 sql/share/swedish/
 sql/share/ukrainian/
+|=======
+sql/share/norwegian-ny/errmsg.sys
+sql/share/norwegian/errmsg.sys
+|>>>>>>> MERGE-SOURCE
 sql/sql_builtin.cc
 sql/sql_select.cc.orig
 sql/sql_yacc.cc
@@ -1861,12 +1875,16 @@ unittest/examples/.deps/simple-t.Po
 unittest/examples/.deps/skip-t.Po
 unittest/examples/.deps/skip_all-t.Po
 unittest/examples/.deps/todo-t.Po
+|<<<<<<< TREE
 unittest/maria_control
+|=======
+|>>>>>>> MERGE-SOURCE
 unittest/mysys/*.t
 unittest/mysys/.deps/base64-t.Po
 unittest/mysys/.deps/bitmap-t.Po
 unittest/mysys/.deps/my_atomic-t.Po
 unittest/mytap/.deps/tap.Po
+|<<<<<<< TREE
 unittest/mysys/mf_pagecache_consist_1k-t-big
 unittest/mysys/mf_pagecache_consist_1kHC-t-big
 unittest/mysys/mf_pagecache_consist_1kRD-t-big
@@ -1876,11 +1894,16 @@ unittest/mysys/mf_pagecache_consist_64kH
 unittest/mysys/mf_pagecache_consist_64kRD-t-big
 unittest/mysys/mf_pagecache_consist_64kWR-t-big
 unittest/mysys/mf_pagecache_single_64k-t-big
+|=======
+|>>>>>>> MERGE-SOURCE
 unittest/mytap/t/*.t
 unittest/mytap/t/.deps/basic-t.Po
+|<<<<<<< TREE
 unittest/page_cache_test_file_1
 unittest/pagecache_debug.log
 unittest/tmp/*
+|=======
+|>>>>>>> MERGE-SOURCE
 unittest/unit
 vi.h
 vio/*.ds?

=== modified file 'client/mysqltest.c'
--- a/client/mysqltest.c	2008-07-22 14:16:22 +0000
+++ b/client/mysqltest.c	2008-07-28 17:08:56 +0000
@@ -1353,23 +1353,21 @@ void show_diff(DYNAMIC_STRING* ds,
   if (init_dynamic_string(&ds_tmp, "", 256, 256))
     die("Out of memory");
 
-  /* First try with diff --help to see if the command exists at all */
+  /* First try with unified diff */
   if (run_tool("diff",
                &ds_tmp, /* Get output from diff in ds_tmp */
-               "--help",
+               "-u",
+               filename1,
+               filename2,
                "2>&1",
-               NULL) != 0) /* Most "diff --help" tools return 0 */
-  {
-    diff_failed= "You don't appear to have diff installed";
-  }
-  else
+               NULL) > 1) /* Most "diff" tools return >1 if error */
   {
     dynstr_set(&ds_tmp, "");
-    /* First try with unified diff */
 
+    /* Fallback to context diff with "diff -c" */
     if (run_tool("diff",
                  &ds_tmp, /* Get output from diff in ds_tmp */
-                 "-u",
+                 "-c",
                  filename1,
                  filename2,
                  "2>&1",
@@ -1377,17 +1375,17 @@ void show_diff(DYNAMIC_STRING* ds,
     {
       dynstr_set(&ds_tmp, "");
 
-      /* Fallback to context diff with "diff -c" */
+      /* Fallback to plain "diff" */
       if (run_tool("diff",
                    &ds_tmp, /* Get output from diff in ds_tmp */
-                   "-c",
                    filename1,
                    filename2,
                    "2>&1",
                    NULL) > 1) /* Most "diff" tools return >1 if error */
       {
         dynstr_set(&ds_tmp, "");
-        diff_failed= "Could not execute 'diff -u' or 'diff -c'";
+
+        diff_failed= "Could not execute 'diff -u', 'diff -c' or 'diff'";
       }
     }
   }

=== modified file 'mysql-test/Makefile.am'
--- a/mysql-test/Makefile.am	2008-07-23 09:31:19 +0000
+++ b/mysql-test/Makefile.am	2008-07-28 17:08:56 +0000
@@ -38,9 +38,11 @@ nobase_test_DATA = lib/mtr_cases.pm \
 	lib/My/Config.pm \
 	lib/My/Find.pm \
 	lib/My/Options.pm \
+	lib/My/Test.pm \
 	lib/My/Platform.pm \
 	lib/My/SafeProcess.pm \
 	lib/My/File/Path.pm \
+	lib/My/SysInfo.pm \
 	lib/My/SafeProcess/Base.pm \
 	lib/My/SafeProcess/safe_process.pl
 
@@ -63,7 +65,7 @@ TEST_DIRS = t r include std_data std_dat
 	suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \
 	suite/bugs/data suite/bugs/t suite/bugs/r \
 	suite/federated \
-	suite/funcs_1 suite/funcs_1/bitdata suite/funcs_1/data \
+	suite/funcs_1 suite/funcs_1/bitdata \
 	suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \
 	suite/funcs_1/t suite/funcs_1/views suite/funcs_1/cursors \
 	suite/funcs_1/datadict suite/funcs_1/storedproc suite/funcs_1/triggers \

=== modified file 'mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2008-03-12 08:34:37 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2008-07-28 17:08:56 +0000
@@ -497,7 +497,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,
 --echo ********************************************
 --echo
 connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
 --query_vertical SHOW SLAVE STATUS
@@ -554,7 +554,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing
 --echo ********************************************
 --echo
 connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
 --query_vertical SHOW SLAVE STATUS
@@ -697,7 +697,7 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDE
 # Remove below once fixed
 #***************************
 connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
 --query_vertical SHOW SLAVE STATUS
@@ -763,7 +763,7 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 O
 --echo ********************************************
 --echo
 connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
 --query_vertical SHOW SLAVE STATUS
@@ -840,7 +840,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDE
 --echo *****************
 --echo
 connection slave;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
 --query_vertical SHOW SLAVE STATUS

=== modified file 'mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2008-03-06 18:32:47 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2008-07-10 16:09:39 +0000
@@ -94,7 +94,7 @@ SELECT * FROM t2 ORDER BY a;
 --echo *** Start Slave ***
 connection slave;
 START SLAVE;
-wait_for_slave_to_stop;
+source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
 --query_vertical SHOW SLAVE STATUS
@@ -429,6 +429,7 @@ set @b1 = 'b1b1b1b1';
 set @b1 = concat(@b1,@b1);
 INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
 
+connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #

=== modified file 'mysql-test/extra/rpl_tests/rpl_log.test'
--- a/mysql-test/extra/rpl_tests/rpl_log.test	2008-04-08 06:34:40 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_log.test	2008-07-28 17:08:56 +0000
@@ -9,10 +9,8 @@
 # test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
 # We wait for the slave to have written all he wants to the binlog
 # (otherwise RESET MASTER may come too early).
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
+sync_slave_with_master;
+source include/stop_slave.inc;
 reset master;
 reset slave;
 # We are going to read the slave's binlog which contains file_id (for some LOAD
@@ -81,17 +79,14 @@ select * from t1 order by 1 asc;
 
 save_master_pos;
 connection slave;
-# Note that the above 'slave start' will cause a 3rd rotate event (a fake one)
-# to go into the relay log (the master always sends a fake one when replication
-# starts). 
-start slave;
-let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%';
---source include/wait_slave_status.inc
+source include/start_slave.inc;
+
 sync_with_master;
 #check t1 on slave to ensure whether it's identical with on master
 select * from t1 order by 1 asc;
 flush logs;
-stop slave;
+source include/stop_slave.inc;
+source include/start_slave.inc;
 connection master;
 
 # Create some entries for second log
@@ -104,10 +99,7 @@ source include/show_binlog_events.inc;
 --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
 show binlog events in 'master-bin.000002';
 show binary logs;
-save_master_pos;
-connection slave;
-start slave;
-sync_with_master;
+sync_slave_with_master;
 show binary logs;
 --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
 --replace_column 2 # 5 #

=== modified file 'mysql-test/include/have_log_bin.inc'
--- a/mysql-test/include/have_log_bin.inc	2008-07-04 16:41:27 +0000
+++ b/mysql-test/include/have_log_bin.inc	2008-07-28 17:08:56 +0000
@@ -1,3 +1,11 @@
+# ==== Purpose ====
+# 
+# Ensure that the server is running with binlogging on
+#
+# ==== Usage ====
+#
+# source include/have_log_bin.inc;
+
 -- require r/have_log_bin.require
 disable_query_log;
 show variables like 'log_bin';

=== modified file 'mysql-test/include/master-slave-reset.inc'
--- a/mysql-test/include/master-slave-reset.inc	2008-04-30 03:14:44 +0000
+++ b/mysql-test/include/master-slave-reset.inc	2008-07-28 17:08:56 +0000
@@ -1,7 +1,19 @@
+# Reset the master and the slave to start fresh.
+#
+# It is necessary to execute RESET MASTER and RESET SLAVE on both
+# master and slave since the replication setup might be circular.
+#
+# Since we expect STOP SLAVE to produce a warning as the slave is
+# stopped (the server was started with skip-slave-start), we disable
+# warnings when doing STOP SLAVE.
+
 connection slave;
+|<<<<<<< TREE
 
 #we expect STOP SLAVE to produce a warning as the slave is stopped
 #(the server was started with skip-slave-start)
+|=======
+|>>>>>>> MERGE-SOURCE
 --disable_warnings
 stop slave;
 source include/wait_for_slave_to_stop.inc;
@@ -15,6 +27,9 @@ use test;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 --enable_warnings
 reset master;
+--disable_query_log
+reset slave;
+--enable_query_log
 connection slave;
 
 --disable_warnings
@@ -29,13 +44,23 @@ reset slave;
 --disable_warnings
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 --enable_warnings
+|<<<<<<< TREE
 
+|=======
+|>>>>>>> MERGE-SOURCE
 --disable_query_log
+|<<<<<<< TREE
 eval CHANGE MASTER TO MASTER_USER='root',
                       MASTER_CONNECT_RETRY=1,
                       MASTER_HOST='127.0.0.1',
                       MASTER_PORT=$MASTER_MYPORT;
+|=======
+reset master;
+|>>>>>>> MERGE-SOURCE
 --enable_query_log
+|<<<<<<< TREE
 
+|=======
+|>>>>>>> MERGE-SOURCE
 start slave;
 source include/wait_for_slave_to_start.inc;

=== modified file 'mysql-test/include/reset_master_and_slave.inc'
--- a/mysql-test/include/reset_master_and_slave.inc	2007-11-06 16:51:32 +0000
+++ b/mysql-test/include/reset_master_and_slave.inc	2008-07-10 16:09:39 +0000
@@ -1,10 +1,8 @@
 --echo **** Resetting master and slave ****
 connection slave;
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
+source include/stop_slave.inc;
 RESET SLAVE;
 connection master;
 RESET MASTER;
 connection slave;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+source include/start_slave.inc;

=== modified file 'mysql-test/include/wait_for_slave_io_to_stop.inc'
--- a/mysql-test/include/wait_for_slave_io_to_stop.inc	2007-06-19 11:06:11 +0000
+++ b/mysql-test/include/wait_for_slave_io_to_stop.inc	2008-07-10 16:09:39 +0000
@@ -1,33 +1,18 @@
-###################################################
-#Author: Jeb
-#Date: 2007-06-11
-#Purpose: used for io errors on the slave. If Slave gets an io
-#         error, the io trhead should stop
-#Details:
-#      1) Fill in and setup variables
-#      2) loop through looking for
-#         sql threads to stop
-#      3) If loops too long die.
-####################################################
-connection slave;
-let $my_show= SHOW SLAVE STATUS;
-let $sql_running= Slave_IO_Running;
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
-
-while ($run)
-{
-  let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
-  if (`SELECT '$io_result' = 'No'`){
-    let $run= 0;
-  }
-  sleep 0.1;
-  if (!$counter){
-    --echo "Failed while waiting for slave IO thread to stop"
-    query_vertical SHOW SLAVE STATUS;
-    exit;
-  }
-  dec $counter;
-}
+# ==== Purpose ====
+#
+# Waits until the IO thread of the current connection has stopped, or
+# until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_io_to_stop.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $slave_keep_connection. See wait_for_slave_param.inc for
+# descriptions.
 
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= No;
+let $slave_error_message= Failed while waiting for slave IO thread to stop;
+source include/wait_for_slave_param.inc;
+let $slave_error_message= ;

=== modified file 'mysql-test/include/wait_for_slave_param.inc'
--- a/mysql-test/include/wait_for_slave_param.inc	2007-06-15 11:09:28 +0000
+++ b/mysql-test/include/wait_for_slave_param.inc	2008-07-10 16:09:39 +0000
@@ -1,26 +1,94 @@
-# include/wait_for_slave_param.inc
+# ==== Purpose ====
 #
-# SUMMARY
+# Waits until SHOW SLAVE STATUS has returned a specified value, or
+# until a timeout is reached.
 #
-#    Waits until SHOW SLAVE STATUS has returned a spicified value.
+# ==== Usage ====
 #
-# USAGE
+# let $slave_param= Slave_SQL_Running;
+# let $slave_param_value= No;
+# --source include/slave_wait_param.inc
 #
-#    let $slave_param= Slave_SQL_Running;
-#    let $slave_param_value= No;
-#    --source include/slave_wait_param.inc
+# Parameters:
+#
+# $slave_param, $slave_param_value
+#   This macro will wait until the column of the output of SHOW SLAVE
+#   STATUS named $slave_param gets the value $slave_param_value.  See
+#   the example above.
+#
+# $slave_param_comparison
+#   By default, this file waits until $slave_param becomes equal to
+#   $slave_param_value.  If you want to wait until $slave_param
+#   becomes *unequal* to $slave_param_value, set this parameter to the
+#   string '!=', like this:
+#     let $slave_param_comparison= !=;
+#
+# $slave_timeout
+#   The default timeout is 5 minutes. You can change the timeout by
+#   setting $slave_timeout. The unit is tenths of seconds.
+#
+# $slave_keep_connection
+#   If the timeout is reached, debug info is given by calling SHOW
+#   SLAVE STATUS, SHOW PROCESSLIST, and SHOW BINLOG EVENTS.  By
+#   default (assuming the current connection is slave), a 'connection
+#   master' is then issued, and the same information is printed again
+#   on the master host.  You can avoid switching to master (and thus
+#   suppress debug info on master too) by setting
+#   $slave_keep_connection to 1.
+#
+# $slave_error_message
+#   If set, this is printed when a timeout occurs. This is primarily
+#   intended to be used by other wait_for_slave_* macros, to indicate
+#   what the purpose of the wait was. (A very similar error message is
+#   given by default, but the wait_for_slave_* macros use this to give
+#   an error message identical to that in previous versions, so that
+#   errors are easier searchable in the pushbuild history.)
+
+let $_slave_timeout_counter= $slave_timeout;
+if (!$_slave_timeout_counter)
+{
+  let $_slave_timeout_counter= 3000;
+}
+
+let $_slave_param_comparison= $slave_param_comparison;
+if (`SELECT '$_slave_param_comparison' = ''`)
+{
+  let $_slave_param_comparison= =;
+}
 
-let $slave_wait_param_counter= 300;
-let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
-while (`select "$slave_value" != "$slave_param_value"`)
+let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
+while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_param_value')`)
 {
-  dec $slave_wait_param_counter;
-  if (!$slave_wait_param_counter)
+  if (!$_slave_timeout_counter)
   {
-    --echo ERROR: failed while waiting for slave parameter $slave_param: $slave_param_value
-    query_vertical show slave status;
+    --echo **** ERROR: failed while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
+    if (`SELECT '$slave_error_message' != ''`)
+    {
+      --echo Message: $slave_error_message
+    }
+    --echo Note: the following output may have changed since the failure was detected
+    --echo **** Showing SLAVE STATUS, PROCESSLIST, and BINLOG EVENTS on slave ****
+    query_vertical SHOW SLAVE STATUS;
+    SHOW PROCESSLIST;
+    let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
+    eval SHOW BINLOG EVENTS IN '$binlog_name';
+    if (!$slave_keep_connection) {
+      let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
+      let $master_binlog_name_sql= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1);
+      --echo **** Showing MASTER STATUS, PROCESSLIST, and BINLOG EVENTS on master ****
+      --echo [on master]
+      connection master;
+      query_vertical SHOW MASTER STATUS;
+      SHOW PROCESSLIST;
+      eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql';
+      if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`)
+      {
+        eval SHOW BINLOG EVENTS IN '$master_binlog_name_io';
+      }
+    }
     exit;
   }
+  dec $_slave_timeout_counter;
   sleep 0.1;
-  let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
+  let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
 }

=== modified file 'mysql-test/include/wait_for_slave_sql_error.inc'
--- a/mysql-test/include/wait_for_slave_sql_error.inc	2007-10-10 16:10:54 +0000
+++ b/mysql-test/include/wait_for_slave_sql_error.inc	2008-07-10 16:09:39 +0000
@@ -1,33 +1,23 @@
-###################################################
-#Author: Sven
-#Date: 2007-10-09
-#Purpose: Wait until the slave has an error in the
-#         sql thread, as indicated by
-#         "SHOW SLAVE STATUS", or at most 30
-#         seconds.
-#Details:
-#      1) Fill in and setup variables
-#      2) loop, looking for sql error on slave
-#      3) If it loops too long, die.
-####################################################
-connection slave;
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
+# ==== Purpose ====
+#
+# Waits until the SQL thread of the current connection has got an
+# error, or until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_sql_error.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $slave_keep_connection. See wait_for_slave_param.inc for
+# descriptions.
 
-while ($run)
-{
-  let $sql_result= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, $row_number);
-  let $run= `SELECT '$sql_result' = '0'`;
-  if ($run) {
-    real_sleep 0.1;
-    if (!$counter){
-      --echo "Failed while waiting for slave to produce an error in its sql thread"
-      --replace_result $MASTER_MYPORT MASTER_PORT
-      --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
-      query_vertical SHOW SLAVE STATUS;
-      exit;
-    }
-    dec $counter;
-  }
-}
+let $old_slave_param_comparison= $slave_param_comparison;
+
+let $slave_param= Last_SQL_Errno;
+let $slave_param_comparison= !=;
+let $slave_param_value= 0;
+let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
+source include/wait_for_slave_param.inc;
+let $slave_error_message= ;
+
+let $slave_param_comparison= $old_slave_param_comparison;

=== modified file 'mysql-test/include/wait_for_slave_sql_to_start.inc'
--- a/mysql-test/include/wait_for_slave_sql_to_start.inc	2008-06-22 20:05:19 +0000
+++ b/mysql-test/include/wait_for_slave_sql_to_start.inc	2008-07-28 17:08:56 +0000
@@ -1,3 +1,4 @@
+|<<<<<<< TREE
 ###################################################
 #Author:  Mats (based on file written by Jeb)
 #Date:    2008-05-06
@@ -31,3 +32,22 @@ while ($run)
 }
 
 
+|=======
+# ==== Purpose ====
+#
+# Waits the SQL thread of the current connection has started, or until
+# a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_sql_to_start.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $slave_keep_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= Yes;
+let $slave_error_message= Failed while waiting for slave SQL to start;
+source include/wait_for_slave_param.inc;
+|>>>>>>> MERGE-SOURCE

=== modified file 'mysql-test/include/wait_for_slave_sql_to_stop.inc'
--- a/mysql-test/include/wait_for_slave_sql_to_stop.inc	2008-02-27 17:46:06 +0000
+++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc	2008-07-10 16:09:39 +0000
@@ -1,33 +1,18 @@
-###################################################
-#Author: Jeb
-#Date: 2007-06-11
-#Purpose: used for SQL errors on the slave. If Slave gets a sql
-#         error, the SQL trhead should stop
-#Details:
-#      1) Fill in and setup variables
-#      2) loop through looking for
-#         sql threads to stop
-#      3) If loops too long die.
-####################################################
-if (!$keep_connection)
-{
-  connection slave;
-}
-let $row_number= 1;
-let $run= 1;
-let $counter= 300;
+# ==== Purpose ====
+#
+# Waits the SQL thread of the current connection has stopped, or until
+# a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_sql_to_stop.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $slave_keep_connection. See wait_for_slave_param.inc for
+# descriptions.
 
-while ($run)
-{
-  let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
-  if (`SELECT '$sql_result' = 'No'`){
-    let $run= 0;
-  }
-  sleep 0.1;
-  if (!$counter){
-    --echo "Failed while waiting for slave SQL thread to stop"
-    query_vertical SHOW SLAVE STATUS;
-    exit;
-  }
-  dec $counter;
-}
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= No;
+let $slave_error_message= Failed while waiting for slave SQL thread to stop;
+source include/wait_for_slave_param.inc;
+let $slave_error_message= ;

=== modified file 'mysql-test/include/wait_for_slave_to_start.inc'
--- a/mysql-test/include/wait_for_slave_to_start.inc	2008-06-22 20:05:19 +0000
+++ b/mysql-test/include/wait_for_slave_to_start.inc	2008-07-28 17:08:56 +0000
@@ -1,3 +1,4 @@
+|<<<<<<< TREE
 ###################################################
 #Author: Jeb
 #Date: 2007-06-11
@@ -38,3 +39,29 @@ while ($run)
 }
 
 
+|=======
+# ==== Purpose ====
+#
+# Waits until both the IO and SQL threads of the current connection
+# have started, or until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_to_start.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $slave_keep_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+let $slave_error_message= Failed while waiting for slave to start;
+
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= Yes;
+source include/wait_for_slave_param.inc;
+
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= Yes;
+source include/wait_for_slave_param.inc;
+
+let $slave_error_message= ;
+|>>>>>>> MERGE-SOURCE

=== modified file 'mysql-test/include/wait_for_slave_to_stop.inc'
--- a/mysql-test/include/wait_for_slave_to_stop.inc	2008-06-23 07:49:15 +0000
+++ b/mysql-test/include/wait_for_slave_to_stop.inc	2008-07-28 17:08:56 +0000
@@ -1,3 +1,4 @@
+|<<<<<<< TREE
 ###################################################
 #Author: Jeb
 #Date: 2007-06-11
@@ -39,3 +40,29 @@ while ($run)
 }
 
 
+|=======
+# ==== Purpose ====
+#
+# Waits until both the IO and SQL threads of the current connection
+# have stopped, or until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_to_stop.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $slave_keep_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+let $slave_error_message= Failed while waiting for slave to stop;
+
+let $slave_param= Slave_IO_Running;
+let $slave_param_value= No;
+source include/wait_for_slave_param.inc;
+
+let $slave_param= Slave_SQL_Running;
+let $slave_param_value= No;
+source include/wait_for_slave_param.inc;
+
+let $slave_error_message= ;
+|>>>>>>> MERGE-SOURCE

=== removed file 'mysql-test/include/wait_show_pattern.inc'
--- a/mysql-test/include/wait_show_pattern.inc	2007-12-20 17:38:23 +0000
+++ b/mysql-test/include/wait_show_pattern.inc	1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
-# include/wait_show_pattern.inc
-#
-# SUMMARY
-#
-#   Waits until output produced by SHOW statement which particular type is
-#   specified as parameter matches certain pattern or maximum time reached.
-#
-# NOTES
-#
-#   Only the first row produced by the parameter statement is checked.
-#
-# USAGE
-#
-#   let $show_type= <Tail of SHOW statement>;
-#   let $show_pattern= 'Pattern to be used for LIKE matching';
-#   --source wait_show_pattern.inc
-#
-# EXAMPLES
-# 
-#   alter_table-big.test, wait_slave_status.inc
-#
-# SEE ALSO
-#
-#   wait_slave_status.inc, wait_condition.inc (>=5.1)
-#
-###############################################################################
-
---disable_query_log
-
-# We accept to wait maximum 30 seconds (0.2 sec/loop).
-let $wait_counter= 150;
-while ($wait_counter)
-{
-  let $result= `SHOW $show_type`;
-  let $success= `SELECT "$result" LIKE $show_pattern`;
-  if ($success)
-  {
-    let $wait_counter= 0;
-  }
-  if (!$success)
-  {
-    real_sleep 0.2;
-    dec $wait_counter;
-  }
-}
-if (!$success)
-{
-  echo Timeout in wait_show_pattern.inc \$show_type= $show_type \$show_pattern= $show_pattern (\$result= '$result');
-}
-
---enable_query_log

=== removed file 'mysql-test/include/wait_slave_status.inc'
--- a/mysql-test/include/wait_slave_status.inc	2007-01-19 20:15:59 +0000
+++ b/mysql-test/include/wait_slave_status.inc	1970-01-01 00:00:00 +0000
@@ -1,129 +0,0 @@
-# include/wait_slave_status.inc
-#
-# Created by Matthias Leich
-#
-# SUMMARY
-#
-#    Waits until slave has reached certain state or maximum time reached.
-#
-#    (This script will not work, when the SHOW command delivers more than one 
-#    result record, because only the first record will be caught.)
-#
-# USAGE
-#
-#    Set $result_pattern in test file and source this file:
-#
-#      let $result_pattern= <pattern used for LIKE on the result of
-#                           SHOW STATUS SLAVE>
-#      --include wait_slave_status.inc
-#
-# EXAMPLE
-#
-#    The script rpl_until.test:
-#       ...
-#       --replace_result $MASTER_MYPORT MASTER_MYPORT
-#       --replace_column 1 # 9 # 23 # 33 #
-#       --vertical_results show slave status;
-#
-#    outputs
-#       show slave status;
-#       Slave_IO_State  #
-#       Master_Host     127.0.0.1
-#       Master_User     root
-#       Master_Port     MASTER_MYPORT
-#       Connect_Retry   1
-#       Master_Log_File master-bin.000001
-#       Read_Master_Log_Pos     776
-#       Relay_Log_File  slave-relay-bin.000004
-#       Relay_Log_Pos   #
-#       Relay_Master_Log_File   master-bin.000001
-#       Slave_IO_Running        Yes
-#       Slave_SQL_Running       No
-#       Replicate_Do_DB
-#       Replicate_Ignore_DB
-#       Replicate_Do_Table
-#       Replicate_Ignore_Table
-#       Replicate_Wild_Do_Table
-#       Replicate_Wild_Ignore_Table
-#       Last_Errno      0
-#       Last_Error
-#       Skip_Counter    0
-#       Exec_Master_Log_Pos     319
-#       Relay_Log_Space #
-#       Until_Condition Master
-#       Until_Log_File  master-bin.000001
-#       Until_Log_Pos   319
-#       Master_SSL_Allowed      No
-#       Master_SSL_CA_File
-#       Master_SSL_CA_Path
-#       Master_SSL_Cert
-#       Master_SSL_Cipher
-#       Master_SSL_Key
-#       Seconds_Behind_Master   #
-#
-# The main problem with the "show slave status;" in rpl_until is, that
-# depending on the total test engine power and the current load caused by
-# other processes, the expected slave status might be not reached though
-# it will happen in maybe some seconds.
-#
-# The typical problem with rpl_until is that Slave_IO_Running is "No"
-# instead of "Yes".
-#
-# The expected result follows the LIKE pattern:
-#
-#   let $result_pattern= '%127.0.0.1%root%1%master-bin.000001%776%slave-relay-bin.000004%master-bin.000001%Yes%No%0%0%319%Master%master-bin.000001%319%No%';
-#
-# The Slave_IO_Running value is the "Yes" just after the "master-bin.000001".
-#
-# How to get this pattern ?
-#
-#     Any lines "--replace_result ..." and "--replace_colum ..." just before
-#     the SHOW TABLE STATUS and of course the expected result itself
-#     show us columns where the content must be unified, because it is non
-#     deterministic or it depends on the current test environment.
-#
-#     Unfortunately "--replace_result ..." and "--replace_colum ..." do not
-#     affect the result of our assignment    let $my_val= `SHOW SLAVE STATUS`;
-#     Therefore such content must be covered by '%'.
-#
-#     Please be careful. A more simple pattern might be dangerous, because we
-#     might get "wrong" matches. Example: There might be several "Yes" and "No"
-#     within one result row.
-#
-###############################################################################
-
-# We do not want to print the auxiliary commands, because they are not of
-# interest and their amount will vary depending how fast we get the
-# desired state.
---disable_query_log
-
-# The protocol should show
-# - the setting of $result_pattern   and
-# - that this file is sourced           ,
-# because this increases the chance to use the protocol as replay script.
-eval SELECT "let \$result_pattern= $result_pattern ;" AS "";
-SELECT '--source include/wait_slave_status.inc' AS "";
-
-let $show_type= SLAVE STATUS;
-let $show_pattern= $result_pattern;
---enable_query_log
-
---source include/wait_show_pattern.inc
-
-if (!$success)
-{
-let $message= ! Attention: Timeout in wait_slave_status.inc.
-              |       Possible reasons with decreasing probability:
-              |       - The LIKE pattern is wrong, because the
-              |         testcase was altered or the layout of the
-              |         SHOW SLAVE STATUS result set changed.
-              |       - There is a new bug within the replication.
-              |       - We met an extreme testing environment and timeout is
-              |         too small.;
---source include/show_msg80.inc
---echo DEBUG INFO START (wait_slave_status.inc):
---echo $result_pattern
---vertical_results
-show slave status;
---echo DEBUG INFO END
-}

=== modified file 'mysql-test/lib/My/ConfigFactory.pm'
--- a/mysql-test/lib/My/ConfigFactory.pm	2008-04-25 14:09:25 +0000
+++ b/mysql-test/lib/My/ConfigFactory.pm	2008-06-19 08:07:55 +0000
@@ -104,10 +104,16 @@ sub fix_server_id {
 sub fix_socket {
   my ($self, $config, $group_name, $group)= @_;
   # Put socket file in tmpdir
-  my $dir= $group->value('tmpdir');
+  my $dir= $self->{ARGS}->{tmpdir};
   return "$dir/$group_name.sock";
 }
 
+sub fix_tmpdir {
+  my ($self, $config, $group_name, $group)= @_;
+  my $dir= $self->{ARGS}->{tmpdir};
+  return "$dir/$group_name";
+}
+
 sub fix_log_error {
   my ($self, $config, $group_name, $group)= @_;
   my $dir= dirname($group->value('datadir'));
@@ -182,7 +188,7 @@ sub fix_ssl_client_key {
 my @mysqld_rules=
   (
  { 'basedir' => sub { return shift->{ARGS}->{basedir}; } },
- { 'tmpdir' => sub { return shift->{ARGS}->{tmpdir}; } },
+ { 'tmpdir' => \&fix_tmpdir },
  { 'character-sets-dir' => \&fix_charset_dir },
  { 'language' => \&fix_language },
  { 'datadir' => \&fix_datadir },
@@ -295,6 +301,16 @@ my @mysqlbinlog_rules=
 
 
 #
+# Rules to run for [mysql_upgrade] section
+#  - will be run in order listed here
+#
+my @mysql_upgrade_rules=
+(
+ { 'tmpdir' => sub { return shift->{ARGS}->{tmpdir}; } },
+);
+
+
+#
 # Generate a [client.<suffix>] group to be
 # used for connecting to [mysqld.<suffix>]
 #
@@ -600,6 +616,11 @@ sub new_config {
 			     $config->insert('mysqlbinlog'),
 			     @mysqlbinlog_rules);
 
+  # [mysql_upgrade] need additional settings
+  $self->run_rules_for_group($config,
+			     $config->insert('mysql_upgrade'),
+			     @mysql_upgrade_rules);
+
   # Additional rules required for [client]
   $self->run_rules_for_group($config,
 			     $config->insert('client'),

=== modified file 'mysql-test/lib/My/Options.pm'
--- a/mysql-test/lib/My/Options.pm	2008-01-08 14:47:04 +0000
+++ b/mysql-test/lib/My/Options.pm	2008-04-24 11:02:53 +0000
@@ -61,6 +61,9 @@ sub _split_option {
   elsif ($option=~ /^--(.*)$/){
     return ($1, undef)
   }
+  elsif ($option=~ /^\$(.*)$/){ # $VAR
+    return ($1, undef)
+  }
   elsif ($option=~ /^(.*)=(.*)$/){
     return ($1, $2)
   }

=== modified file 'mysql-test/lib/My/SafeProcess.pm'
--- a/mysql-test/lib/My/SafeProcess.pm	2008-04-02 08:08:44 +0000
+++ b/mysql-test/lib/My/SafeProcess.pm	2008-04-27 19:31:32 +0000
@@ -65,7 +65,7 @@ END {
   # Kill any children still running
   for my $proc (values %running){
     if ( $proc->is_child($$) ){
-      print "Killing: $proc\n";
+      #print "Killing: $proc\n";
       $proc->kill();
     }
   }
@@ -128,6 +128,7 @@ sub new {
   my $verbose  = delete($opts{'verbose'});
   my $host     = delete($opts{'host'});
   my $shutdown = delete($opts{'shutdown'});
+  my $user_data= delete($opts{'user_data'});
 
 #  if (defined $host) {
 #    $safe_script=  "lib/My/SafeProcess/safe_process_cpcd.pl";
@@ -173,6 +174,7 @@ sub new {
       SAFE_NAME => $name,
       SAFE_SHUTDOWN => $shutdown,
       PARENT => $$,
+      SAFE_USER_DATA => $user_data,
      }, $class);
 
   # Put the new process in list of running
@@ -461,8 +463,8 @@ sub wait_one {
     return 1;
   }
 
-  warn "wait_one: expected pid $pid but got $retpid"
-    unless( $retpid == $pid );
+  #warn "wait_one: expected pid $pid but got $retpid"
+  #  unless( $retpid == $pid );
 
   $self->_collect();
   return 0;
@@ -546,4 +548,16 @@ sub _verbose {
   print STDERR " ## ", @_, "\n";
 }
 
+
+sub pid {
+  my ($self)= @_;
+  return $self->{SAFE_PID};
+}
+
+sub user_data {
+  my ($self)= @_;
+  return $self->{SAFE_USER_DATA};
+}
+
+
 1;

=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2008-07-22 14:16:22 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2008-07-28 17:08:56 +0000
@@ -40,7 +40,7 @@ our $default_storage_engine;
 our $opt_with_ndbcluster_only;
 our $defaults_file;
 our $defaults_extra_file;
-our $reorder;
+our $reorder= 1;
 
 sub collect_option {
   my ($opt, $value)= @_;
@@ -56,6 +56,7 @@ use File::Spec::Functions qw / splitdir 
 use IO::File();
 use My::Config;
 use My::Platform;
+use My::Test;
 use My::Find;
 
 require "mtr_misc.pl";
@@ -136,52 +137,16 @@ sub collect_test_cases ($$) {
     {
       my @criteria = ();
 
-      # Look for tests that must be run in a defined order - that is
-      # defined by test having the same name except for the ending digit
+      #
+      # Append the criteria for sorting, in order of importance.
+      #
+      push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "A" : "B"));
+      # Group test with equal options together.
+      # Ending with "~" makes empty sort later than filled
+      my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : [];
+      push(@criteria, join("!", sort @{$opts}) . "~");
 
-      # Put variables into hash
-      my $test_name= $tinfo->{'name'};
-      my $depend_on_test_name;
-      if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
-      {
-	my $base_name= $1;
-	my $idx= $2;
-	mtr_verbose("$test_name =>  $base_name idx=$idx");
-	if ( $idx > 1 )
-	{
-	  $idx-= 1;
-	  $base_name= "$base_name$idx";
-	  mtr_verbose("New basename $base_name");
-	}
-
-	foreach my $tinfo2 (@$cases)
-	{
-	  if ( $tinfo2->{'name'} eq $base_name )
-	  {
-	    mtr_verbose("found dependent test $tinfo2->{'name'}");
-	    $depend_on_test_name=$base_name;
-	  }
-	}
-      }
-
-      if ( defined $depend_on_test_name )
-      {
-	mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
-	$sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
-      }
-      else
-      {
-	#
-	# Append the criteria for sorting, in order of importance.
-	#
-	push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
-	# Group test with equal options together.
-	# Ending with "~" makes empty sort later than filled
-	my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : [];
-	push(@criteria, join("!", sort @{$opts}) . "~");
-
-	$sort_criteria{$test_name} = join(" ", @criteria);
-      }
+      $sort_criteria{$tinfo->{name}} = join(" ", @criteria);
     }
 
     @$cases = sort {
@@ -459,7 +424,7 @@ sub collect_one_suite($)
 	  }
 
 	  # Copy test options
-	  my $new_test= {};
+	  my $new_test= My::Test->new();
 	  while (my ($key, $value) = each(%$test)) {
 	    if (ref $value eq "ARRAY") {
 	      push(@{$new_test->{$key}}, @$value);
@@ -571,6 +536,26 @@ sub optimize_cases {
 	}
       }
     }
+
+
+    # =======================================================
+    # Check that engine selected by
+    # --default-storage-engine=<engine> is supported
+    # =======================================================
+    foreach my $opt ( @{$tinfo->{master_opt}} ) {
+      my $default_engine=
+	mtr_match_prefix($opt, "--default-storage-engine=");
+
+      if (defined $default_engine){
+	if ( ! exists $::mysqld_variables{$default_engine} )
+	{
+	 $tinfo->{'skip'}= 1;
+	 $tinfo->{'comment'}=
+	 "'$default_engine' not supported";
+
+	}
+      }
+    }
   }
 }
 
@@ -687,13 +672,16 @@ sub collect_one_test_case {
   # ----------------------------------------------------------------------
   # Set defaults
   # ----------------------------------------------------------------------
-  my $tinfo= {};
-  $tinfo->{'name'}= $suitename . ".$tname";
-  $tinfo->{'path'}= "$testdir/$filename";
-
-  # TODO allow nonexistsing result file
-  # in that case .test must issue "exit" otherwise test should fail by default
-  $tinfo->{'result_file'}= "$resdir/$tname.result";
+  my $tinfo= My::Test->new
+    (
+     name          => "$suitename.$tname",
+     path          => "$testdir/$filename",
+
+     # TODO allow nonexistsing result file
+     # in that case .test must issue "exit" otherwise test
+     # should fail by default
+     result_file   => "$resdir/$tname.result",
+    );
 
   # ----------------------------------------------------------------------
   # Skip some tests but include in list, just mark them as skipped
@@ -874,9 +862,16 @@ sub collect_one_test_case {
     }
   }
 
+  if ($tinfo->{'federated_test'})
+  {
+    # This is a test that need federated, enable it
+    push(@{$tinfo->{'master_opt'}}, "--loose-federated");
+    push(@{$tinfo->{'slave_opt'}}, "--loose-federated");
+  }
+
   if ( $tinfo->{'innodb_test'} )
   {
-      # This is a test that need innodb
+    # This is a test that need innodb
     if ( $::mysqld_variables{'innodb'} ne "TRUE" )
     {
       # innodb is not supported, skip it
@@ -996,7 +991,7 @@ my @tags=
  ["include/master-slave.inc", "rpl_test", 1],
  ["include/ndb_master-slave.inc", "rpl_test", 1],
  ["include/ndb_master-slave.inc", "ndb_test", 1],
- ["include/federated.inc", "federated_test", 1],
+ ["federated.inc", "federated_test", 1],
  ["include/not_embedded.inc", "not_embedded", 1],
 );
 
@@ -1058,19 +1053,6 @@ sub unspace {
 }
 
 
-
-sub envsubst {
-  my $string= shift;
-
-  if ( ! defined $ENV{$string} )
-  {
-    mtr_error(".opt file references '$string' which is not set");
-  }
-
-  return $ENV{$string};
-}
-
-
 sub opts_from_file ($) {
   my $file=  shift;
 
@@ -1107,10 +1089,6 @@ sub opts_from_file ($) {
         or $arg =~ s/^([^\'\"]*)\"(.*)\"([^\'\"]*)$/$1$2$3/;
       $arg =~ s/\\\\/\\/g;
 
-      # Expand environment variables
-      $arg =~ s/\$\{(\w+)\}/envsubst($1)/ge;
-      $arg =~ s/\$(\w+)/envsubst($1)/ge;
-
       # Do not pass empty string since my_getopt is not capable to handle it.
       if (length($arg)) {
 	push(@args, $arg);
@@ -1126,17 +1104,7 @@ sub print_testcases {
 
   print "=" x 60, "\n";
   foreach my $test (@cases){
-    print "[", $test->{name}, "]", "\n";
-    while ((my ($key, $value)) = each(%$test)) {
-      print " ", $key, "= ";
-      if (ref $value eq "ARRAY") {
-	print "[", join(", ", @$value), "]";
-      } else {
-	print $value;
-      }
-      print "\n";
-    }
-    print "\n";
+    $test->print_test();
   }
   print "=" x 60, "\n";
 }

=== modified file 'mysql-test/lib/mtr_report.pm'
--- a/mysql-test/lib/mtr_report.pm	2008-07-22 14:16:22 +0000
+++ b/mysql-test/lib/mtr_report.pm	2008-07-28 17:08:56 +0000
@@ -26,7 +26,8 @@ our @EXPORT= qw(report_option mtr_print_
 		mtr_print_header mtr_report mtr_report_stats
 		mtr_warning mtr_error mtr_debug mtr_verbose
 		mtr_verbose_restart mtr_report_test_passed
-		mtr_report_test_failed mtr_report_test_skipped);
+		mtr_report_test_skipped mtr_print
+		mtr_report_test);
 
 use mtr_match;
 require "mtr_io.pl";
@@ -34,7 +35,11 @@ require "mtr_io.pl";
 my $tot_real_time= 0;
 
 our $timestamp= 0;
-our $timediff= 1;
+our $timediff= 0;
+our $name;
+our $verbose;
+our $verbose_restart= 0;
+our $timer= 1;
 
 sub report_option {
   my ($opt, $value)= @_;
@@ -43,115 +48,134 @@ sub report_option {
   $opt =~ s/-/_/g;
   no strict 'refs';
   ${$opt}= $value;
+
+  #print $name, " setting $opt to ", (defined $value? $value : "undef") ,"\n";
 }
 
-sub SHOW_SUITE_NAME() { return  1; };
+sub _name {
+  return $name ? $name." " : undef;
+}
 
 sub _mtr_report_test_name ($) {
   my $tinfo= shift;
   my $tname= $tinfo->{name};
 
-  # Remove suite part of name
-  $tname =~ s/.*\.// unless SHOW_SUITE_NAME;
+  return unless defined $verbose;
 
   # Add combination name if any
   $tname.= " '$tinfo->{combination}'"
     if defined $tinfo->{combination};
 
-  print _timestamp();
-  printf "%-30s ", $tname;
+  print _name(), _timestamp();
+  printf "%-40s ", $tname;
 }
 
 
 sub mtr_report_test_skipped ($) {
-  my $tinfo= shift;
-  _mtr_report_test_name($tinfo);
-
+  my ($tinfo)= @_;
   $tinfo->{'result'}= 'MTR_RES_SKIPPED';
-  if ( $tinfo->{'disable'} )
-  {
-    mtr_report("[ disabled ]  $tinfo->{'comment'}");
-  }
-  elsif ( $tinfo->{'comment'} )
-  {
-    if ( $tinfo->{skip_detected_by_test} )
-    {
-      mtr_report("[ skip ].  $tinfo->{'comment'}");
-    }
-    else
-    {
-      mtr_report("[ skip ]  $tinfo->{'comment'}");
-    }
-  }
-  else
-  {
-    mtr_report("[ skip ]");
-  }
+
+  mtr_report_test($tinfo);
 }
 
 
-sub mtr_report_test_passed ($$) {
-  my ($tinfo, $use_timer)= @_;
-  _mtr_report_test_name($tinfo);
+sub mtr_report_test_passed ($) {
+  my ($tinfo)= @_;
 
-  my $timer=  "";
-  if ( $use_timer and -f "$::opt_vardir/log/timer" )
+  # Save the timer value
+  my $timer_str=  "";
+  if ( $timer and -f "$::opt_vardir/log/timer" )
   {
-    $timer= mtr_fromfile("$::opt_vardir/log/timer");
-    $tot_real_time += ($timer/1000);
-    $timer= sprintf "%12s", $timer;
+    $timer_str= mtr_fromfile("$::opt_vardir/log/timer");
+    $tinfo->{timer}= $timer_str;
   }
+
   # Set as passed unless already set
   if ( not defined $tinfo->{'result'} ){
     $tinfo->{'result'}= 'MTR_RES_PASSED';
   }
-  mtr_report("[ pass ]   $timer");
+
+  mtr_report_test($tinfo);
 }
 
 
-sub mtr_report_test_failed ($$) {
-  my ($tinfo, $logfile)= @_;
+sub mtr_report_test ($) {
+  my ($tinfo)= @_;
   _mtr_report_test_name($tinfo);
 
-  $tinfo->{'result'}= 'MTR_RES_FAILED';
-  my $test_failures= $tinfo->{'failures'} || 0;
-  $tinfo->{'failures'}=  $test_failures + 1;
-  if ( defined $tinfo->{'warnings'} )
-  {
-    mtr_report("[ fail ]  Found warnings in server log file!");
-    mtr_report($tinfo->{'warnings'});
-    return;
-  }
-  elsif ( defined $tinfo->{'timeout'} )
-  {
-    mtr_report("[ fail ]  timeout");
-    return;
-  }
-  else
-  {
-    mtr_report("[ fail ]");
-  }
+  if ($tinfo->{'result'} eq 'MTR_RES_FAILED'){
 
-  if ( $tinfo->{'comment'} )
-  {
-    # The test failure has been detected by mysql-test-run.pl
-    # when starting the servers or due to other error, the reason for
-    # failing the test is saved in "comment"
-    mtr_report("\nERROR: $tinfo->{'comment'}");
+    if ( defined $tinfo->{'warnings'} )
+    {
+      mtr_report("[ fail ]  Found warnings in server log file!");
+      mtr_report($tinfo->{'warnings'});
+      return;
+    }
+    if ( defined $tinfo->{'timeout'} )
+    {
+      mtr_report("[ fail ]  timeout");
+      return;
+    }
+    else
+    {
+      mtr_report("[ fail ]");
+    }
+
+    if ( $tinfo->{'comment'} )
+    {
+      # The test failure has been detected by mysql-test-run.pl
+      # when starting the servers or due to other error, the reason for
+      # failing the test is saved in "comment"
+      mtr_report("\nERROR: $tinfo->{'comment'}");
+    }
+    elsif ( $tinfo->{logfile} )
+    {
+      # Test failure was detected by test tool and its report
+      # about what failed has been saved to file. Display the report.
+      mtr_report("\n");
+      mtr_report($tinfo->{logfile}, "\n");
+
+    }
+    else
+    {
+      # Neither this script or the test tool has recorded info
+      # about why the test has failed. Should be debugged.
+      mtr_report("\nUnexpected termination, probably when starting mysqld");;
+    }
   }
-  elsif ( defined $logfile and -f $logfile )
+  elsif ($tinfo->{'result'} eq 'MTR_RES_SKIPPED')
   {
-    # Test failure was detected by test tool and its report
-    # about what failed has been saved to file. Display the report.
-    print "\n";
-    mtr_printfile($logfile);
-    print "\n";
+    if ( $tinfo->{'disable'} )
+    {
+      mtr_report("[ disabled ]  $tinfo->{'comment'}");
+    }
+    elsif ( $tinfo->{'comment'} )
+    {
+      if ( $tinfo->{skip_detected_by_test} )
+      {
+	mtr_report("[ skip ]. $tinfo->{'comment'}");
+      }
+      else
+      {
+	mtr_report("[ skip ]  $tinfo->{'comment'}");
+      }
+    }
+    else
+    {
+      mtr_report("[ skip ]");
+    }
   }
-  else
+  elsif ($tinfo->{'result'} eq 'MTR_RES_PASSED')
   {
-    # Neither this script or the test tool has recorded info
-    # about why the test has failed. Should be debugged.
-    mtr_report("\nUnexpected termination, probably when starting mysqld");;
+    my $timer_str= $tinfo->{timer} || "";
+    $tot_real_time += ($timer_str/1000);
+    mtr_report("[ pass ] ", sprintf("%5s", $timer_str));
+
+    # Show any problems check-testcase found
+    if ( defined $tinfo->{'check'} )
+    {
+      mtr_report($tinfo->{'check'});
+    }
   }
 }
 
@@ -172,22 +196,27 @@ sub mtr_report_stats ($) {
 
   foreach my $tinfo (@$tests)
   {
-    if ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' )
+    if ( $tinfo->{failures} )
+    {
+      # Test has failed at least one time
+      $tot_tests++;
+      $tot_failed++;
+    }
+    elsif ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' )
     {
+      # Test was skipped
       $tot_skiped++;
     }
     elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' )
     {
+      # Test passed
       $tot_tests++;
       $tot_passed++;
     }
-    elsif ( $tinfo->{'result'} eq 'MTR_RES_FAILED' )
-    {
-      $tot_tests++;
-      $tot_failed++;
-    }
+
     if ( $tinfo->{'restarted'} )
     {
+      # Servers was restarted
       $tot_restarts++;
     }
 
@@ -207,7 +236,7 @@ sub mtr_report_stats ($) {
   # ----------------------------------------------------------------------
   print "The servers were restarted $tot_restarts times\n";
 
-  if ( $::opt_timer )
+  if ( $timer )
   {
     use English;
 
@@ -249,6 +278,14 @@ sub mtr_report_stats ($) {
   # Print a list of testcases that failed
   if ( $tot_failed != 0 )
   {
+
+    # Print each failed test, again
+    #foreach my $test ( @$tests ){
+    #  if ( $test->{failures} ) {
+    #    mtr_report_test($test);
+    #  }
+    #}
+
     my $ratio=  $tot_passed * 100 / $tot_tests;
     print "Failed $tot_failed/$tot_tests tests, ";
     printf("%.2f", $ratio);
@@ -262,7 +299,7 @@ sub mtr_report_stats ($) {
     foreach my $tinfo (@$tests)
     {
       my $tname= $tinfo->{'name'};
-      if ( $tinfo->{'result'} eq 'MTR_RES_FAILED' and ! $seen{$tname})
+      if ( $tinfo->{failures} and ! $seen{$tname})
       {
         print " $tname";
 	$seen{$tname}= 1;
@@ -280,7 +317,7 @@ sub mtr_report_stats ($) {
    }
   else
   {
-    print "All $tot_tests tests were successful.\n";
+    print "All $tot_tests tests were successful.\n\n";
   }
 
   if ( $tot_failed != 0 || $found_problems)
@@ -309,14 +346,11 @@ sub mtr_print_thick_line {
 
 sub mtr_print_header () {
   print "\n";
-  if ( $::opt_timer )
-  {
-    print "TEST                            RESULT        TIME (ms)\n";
-  }
-  else
-  {
-    print "TEST                            RESULT\n";
-  }
+  printf "TEST";
+  print " " x 38;
+  print "RESULT   ";
+  print "TIME (ms)" if $timer;
+  print "\n";
   mtr_print_line();
   print "\n";
 }
@@ -355,38 +389,50 @@ sub _timestamp {
 		 $tm->hour, $tm->min, $tm->sec, $diff);
 }
 
+# Always print message to screen
+sub mtr_print (@) {
+  print _name(), join(" ", @_), "\n";
+}
+
 
-# Print message to screen
+# Print message to screen if verbose is defined
 sub mtr_report (@) {
-  print join(" ", @_), "\n";
+  if (defined $verbose)
+  {
+    print _name(), join(" ", @_), "\n";
+  }
 }
 
 
 # Print warning to screen
 sub mtr_warning (@) {
-  print STDERR _timestamp(), "mysql-test-run: WARNING: ", join(" ", @_), "\n";
+  print STDERR _name(), _timestamp(),
+    "mysql-test-run: WARNING: ", join(" ", @_), "\n";
 }
 
 
 # Print error to screen and then exit
 sub mtr_error (@) {
-  print STDERR _timestamp(), "mysql-test-run: *** ERROR: ", join(" ", @_), "\n";
+  print STDERR _name(), _timestamp(),
+    "mysql-test-run: *** ERROR: ", join(" ", @_), "\n";
   exit(1);
 }
 
 
 sub mtr_debug (@) {
-  if ( $::opt_verbose > 1 )
+  if ( $verbose > 2 )
   {
-    print STDERR _timestamp(), "####: ", join(" ", @_), "\n";
+    print STDERR _name(),
+      _timestamp(), "####: ", join(" ", @_), "\n";
   }
 }
 
 
 sub mtr_verbose (@) {
-  if ( $::opt_verbose )
+  if ( $verbose )
   {
-    print STDERR _timestamp(), "> ",join(" ", @_),"\n";
+    print STDERR _name(), _timestamp(),
+      "> ",join(" ", @_),"\n";
   }
 }
 
@@ -394,9 +440,10 @@ sub mtr_verbose (@) {
 sub mtr_verbose_restart (@) {
   my ($server, @args)= @_;
   my $proc= $server->{proc};
-  if ( $::opt_verbose_restart )
+  if ( $verbose_restart )
   {
-    print STDERR _timestamp(), "> Restart $proc - ",join(" ", @args),"\n";
+    print STDERR _name(),_timestamp(),
+      "> Restart $proc - ",join(" ", @args),"\n";
   }
 }
 

=== modified file 'mysql-test/mysql-test-run.pl' (properties changed: +x to -x)
--- a/mysql-test/mysql-test-run.pl	2008-07-24 20:19:36 +0000
+++ b/mysql-test/mysql-test-run.pl	2008-07-28 17:08:56 +0000
@@ -41,6 +41,7 @@ use Getopt::Long;
 use My::File::Path; # Patched version of File::Path
 use File::Basename;
 use File::Copy;
+use File::Find;
 use File::Temp qw / tempdir /;
 use File::Spec::Functions qw / splitdir /;
 use My::Platform;
@@ -48,9 +49,12 @@ use My::SafeProcess;
 use My::ConfigFactory;
 use My::Options;
 use My::Find;
+use My::SysInfo;
 use mtr_cases;
 use mtr_report;
 use mtr_match;
+use IO::Socket::INET;
+use IO::Select;
 
 require "lib/mtr_process.pl";
 require "lib/mtr_io.pl";
@@ -88,7 +92,6 @@ my $DEFAULT_SUITES= "main,backup,binlog,
 my $opt_suites;
 
 our $opt_verbose= 0;  # Verbose output, enable with --verbose
-our $opt_verbose_restart= 0;  # Verbose output for restarts
 
 our $exe_mysql;
 our $exe_mysqladmin;
@@ -142,7 +145,7 @@ my $config; # The currently running conf
 my $current_config_name; # The currently running config file template
 
 my $opt_baseport;
-my $opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
+my $opt_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
 
 my $opt_record;
 my $opt_report_features;
@@ -151,10 +154,17 @@ my $opt_mark_progress;
 
 my $opt_sleep;
 
+|<<<<<<< TREE
 my $opt_testcase_timeout=    15; # 15 minutes
 my $opt_suite_timeout   =   360; # 6 hours
 my $opt_shutdown_timeout=    10; # 10 seconds
 my $opt_start_timeout   =    30; # 30 seconds
+|=======
+my $opt_testcase_timeout=    15; # minutes
+my $opt_suite_timeout   =   180; # minutes
+my $opt_shutdown_timeout=    10; # seconds
+my $opt_start_timeout   =   180; # seconds
+|>>>>>>> MERGE-SOURCE
 
 my $opt_start;
 my $opt_start_dirty;
@@ -162,9 +172,9 @@ my $opt_repeat= 1;
 my $opt_retry= 3;
 my $opt_retry_failure= 2;
 
-my $opt_strace_client;
+my $opt_parallel;
 
-our $opt_timer= 1;
+my $opt_strace_client;
 
 our $opt_user;
 
@@ -196,37 +206,69 @@ our %mysqld_variables;
 my $source_dist= 0;
 
 my $opt_max_save_core= $ENV{MTR_MAX_SAVE_CORE} || 5;
-my $num_saved_cores= 0;  # Number of core files saved in vardir/log/ so far.
-
 my $opt_max_save_datadir= $ENV{MTR_MAX_SAVE_DATADIR} || 20;
-my $num_saved_datadir= 0;  # Number of datadirs saved in vardir/log/ so far.
+my $opt_max_test_fail= $ENV{MTR_MAX_TEST_FAIL} || 10;
 
 select(STDOUT);
 $| = 1; # Automatically flush STDOUT
 
 main();
 
+
 sub main {
+  report_option('verbose', 0);
 
-  command_line_setup();
+  # This is needed for test log evaluation in "gen-build-status-page"
+  # in all cases where the calling tool does not log the commands
+  # directly before it executes them, like "make test-force-pl" in RPM builds.
+  mtr_report("Logging: $0 ", join(" ", @ARGV));
 
-  mtr_report("Checking supported features...");
+  Getopt::Long::Configure("pass_through");
+  GetOptions('parallel=i' => \$opt_parallel) or usage(0, "Can't read options");
 
-  check_ndbcluster_support(\%mysqld_variables);
-  check_ssl_support(\%mysqld_variables);
-  check_debug_support(\%mysqld_variables);
+  if ( not defined $opt_parallel ) {
+    # Try to find a suitable value for number of workers
+    my $sys_info= My::SysInfo->new();
 
-  executable_setup();
+    $opt_parallel= $sys_info->num_cpus();
+    for my $limit (2000, 1500, 1000, 500){
+      $opt_parallel-- if ($sys_info->min_bogomips() < $limit);
+    }
+    $opt_parallel= 1 if ($opt_parallel < 1);
+    mtr_report("Using parallel: $opt_parallel");
+  }
 
-  environment_setup();
+  # Create server socket on any free port
+  my $server = new IO::Socket::INET
+    (
+     LocalAddr => 'localhost',
+     Proto => 'tcp',
+     Listen => $opt_parallel,
+    );
+  mtr_error("Could not create testcase server port: $!") unless $server;
+  my $server_port = $server->sockport();
+  mtr_report("Using server port $server_port");
+
+  # Create child processes
+  my %children;
+  for my $child_num (1..$opt_parallel){
+    my $child_pid= My::SafeProcess::Base::_safe_fork();
+    if ($child_pid == 0){
+      $server= undef; # Close the server port in child
+      run_worker($server_port, $child_num);
+      exit(1);
+    }
 
-  if ( $opt_gcov )
-  {
+    $children{$child_pid}= 1;
+  }
+
+  command_line_setup(0);
+
+  if ( $opt_gcov ) {
     gcov_prepare();
   }
 
-  if (!$opt_suites)
-  {
+  if (!$opt_suites) {
     $opt_suites= $DEFAULT_SUITES;
 
     # Check for any extra suites to enable based on the path name
@@ -245,10 +287,9 @@ sub main {
        "mysql-6.0-falcon-kevin"         => "falcon_team",
       );
 
-    foreach my $dir ( reverse splitdir($basedir) )
-    {
+    foreach my $dir ( reverse splitdir($basedir) ) {
       my $extra_suite= $extra_suites{$dir};
-      if (defined $extra_suite){
+      if (defined $extra_suite) {
 	mtr_report("Found extra suite: $extra_suite");
 	$opt_suites= "$extra_suite,$opt_suites";
 	last;
@@ -259,42 +300,393 @@ sub main {
   mtr_report("Collecting tests...");
   my $tests= collect_test_cases($opt_suites, \@opt_cases);
 
-  initialize_servers();
-
   if ( $opt_report_features ) {
     # Put "report features" as the first test to run
-    my $tinfo = {};
-    $tinfo->{'name'} = 'report_features';
-    $tinfo->{'result_file'} = undef; # Prints result
-    $tinfo->{'path'} = 'include/report-features.test';
-    $tinfo->{'master_opt'} = [];
-    $tinfo->{'slave_opt'} = [];
+    my $tinfo = My::Test->new
+      (
+       name           => 'report_features',
+       result_file    => undef, # Prints result
+       path           => 'include/report-features.test'.
+       master_opt     => [],
+       slave_opt      => [],
+      );
     unshift(@$tests, $tinfo);
   }
 
+  initialize_servers();
+
+  mtr_report();
+  mtr_print_thick_line();
+  mtr_print_header();
+
+  my $num_tests= @$tests;
+  my $completed= run_test_server($server, $tests, $opt_parallel);
+
+  # Send Ctrl-C to any children still running
+  kill("INT", keys(%children));
+
+  # Wait for childs to exit
+  foreach my $pid (keys %children)
+  {
+    my $ret_pid= waitpid($pid, 0);
+    if ($ret_pid != $pid){
+      mtr_report("Unknown process $ret_pid exited");
+    }
+    else {
+      delete $children{$ret_pid};
+    }
+  }
+
+  if ( not defined @$completed ) {
+    mtr_error("Test suite aborted");
+  }
+
+  if ( @$completed != $num_tests){
+
+    if ($opt_force){
+      # All test should have been run, print any that are still in $tests
+      foreach my $test ( @$tests ){
+	$test->print_test();
+      }
+    }
+
+    # Not all tests completed, failure
+    mtr_report();
+    mtr_report("Only ", int(@$completed), " of $num_tests completed.");
+    mtr_error("Not all tests completed");
+  }
+
+  mtr_print_line();
+
+  mtr_report_stats($completed);
+
+  exit(0);
+}
+
+
+sub run_test_server {
+  my ($server, $tests, $childs) = @_;
+
+  my $num_saved_cores= 0;  # Number of core files saved in vardir/log/ so far.
+  my $num_saved_datadir= 0;  # Number of datadirs saved in vardir/log/ so far.
+  my $num_failed_test= 0; # Number of tests failed so far
+
+  # Scheduler variables
+  my $max_ndb= $opt_parallel / 2;
+  $max_ndb = 4 if $max_ndb > 4;
+  $max_ndb = 1 if $max_ndb < 1;
+  my $num_ndb_tests= 0;
+
+  my $completed= [];
+  my %running;
+  my $result;
+
+  my $suite_timeout_proc= My::SafeProcess->timer($opt_suite_timeout * 60);
+
+  my $s= IO::Select->new();
+  $s->add($server);
+  while (1) {
+    my @ready = $s->can_read(1); # Wake up once every second
+    foreach my $sock (@ready) {
+      if ($sock == $server) {
+	# New client connected
+	my $child= $sock->accept();
+	mtr_verbose("Client connected");
+	$s->add($child);
+	print $child "HELLO\n";
+      }
+      else {
+	my $line= <$sock>;
+	if (!defined $line) {
+	  # Client disconnected
+	  mtr_verbose("Child closed socket");
+	  $s->remove($sock);
+	  if (--$childs == 0){
+	    $suite_timeout_proc->kill();
+	    return $completed;
+	  }
+	  next;
+	}
+	chomp($line);
+
+	if ($line eq 'TESTRESULT'){
+	  $result= My::Test::read_test($sock);
+	  # $result->print_test();
+
+	  # Report test status
+	  mtr_report_test($result);
+
+	  if ( $result->is_failed() ) {
+
+	    # Save the workers "savedir" in var/log
+	    my $worker_savedir= $result->{savedir};
+	    my $worker_savename= basename($worker_savedir);
+	    my $savedir= "$opt_vardir/log/$worker_savename";
+
+	    if ($opt_max_save_datadir > 0 &&
+		$num_saved_datadir >= $opt_max_save_datadir)
+	    {
+	      mtr_report(" - skipping '$worker_savedir/'");
+	      rmtree($worker_savedir);
+	    }
+	    else {
+	      mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
+	      rename($worker_savedir, $savedir);
+
+	      if ($opt_max_save_core > 0) {
+		# Limit number of core files saved
+		find({ no_chdir => 1,
+		       wanted => sub {
+			 my $core_file= $File::Find::name;
+			 my $core_name= basename($core_file);
+
+			 if ($core_name =~ "core*"){
+			   if ($num_saved_cores >= $opt_max_save_core) {
+			     mtr_report(" - deleting '$core_name'",
+				      "($num_saved_cores/$opt_max_save_core)");
+			     unlink("$core_file");
+			   }
+			   else {
+			     mtr_report(" - found '$core_name'",
+				      "($num_saved_cores/$opt_max_save_core)");
+			   }
+			   ++$num_saved_cores;
+			 }
+		       }
+		     },
+		     $savedir);
+	      }
+	    }
+	    $num_saved_datadir++;
+
+	    if ( !$opt_force ) {
+	      # Test has failed, force is off
+	      $suite_timeout_proc->kill();
+	      push(@$completed, $result);
+	      return $completed;
+	    }
+	    elsif ($opt_max_test_fail > 0 and
+		   $num_failed_test >= $opt_max_test_fail) {
+	      $suite_timeout_proc->kill();
+	      mtr_report("Too many tests($num_failed_test) failed!",
+			 "Terminating...");
+	      return undef;
+	    }
+	    $num_failed_test++;
+	  }
+
+	  # Retry test run after test failure
+	  my $retries= $result->{retries} || 2;
+	  my $test_has_failed= $result->{failures} || 0;
+	  if ($test_has_failed and $retries <= $opt_retry){
+	    # Test should be run one more time unless it has failed
+	    # too many times already
+	    my $failures= $result->{failures};
+	    if ($opt_retry > 1 and $failures >= $opt_retry_failure){
+	      mtr_report("\nTest has failed $failures times,",
+			 "no more retries!\n");
+	    }
+	    else {
+	      mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n");
+	      delete($result->{result});
+	      $result->{retries}= $retries+1;
+	      $result->write_test($sock, 'TESTCASE');
+	      next;
+	    }
+	  }
+
+	  # Repeat test $opt_repeat number of times
+	  my $repeat= $result->{repeat} || 1;
+	  if ($repeat < $opt_repeat)
+	  {
+	    $result->{retries}= 0;
+	    $result->{failures}= 0;
+	    delete($result->{result});
+	    $result->{repeat}= $repeat+1;
+	    $result->write_test($sock, 'TESTCASE');
+	    next;
+	  }
+
+	  # Remove from list of running
+	  mtr_error("'", $result->{name},"' is not known to be running")
+	    unless delete $running{$result->key()};
+
+	  # Update scheduler variables
+	  $num_ndb_tests-- if ($result->{ndb_test});
+
+	  # Save result in completed list
+	  push(@$completed, $result);
+
+	}
+	elsif ($line eq 'START'){
+	  ; # Send first test
+	}
+	else {
+	  mtr_error("Unknown response: '$line' from client");
+	}
+
+	# Find next test to schedule
+	# - Try to use same configuration as worker used last time
+	# - Limit number of parallel ndb tests
+
+	my $next;
+	my $second_best;
+	for(my $i= 0; $i <= $#$tests; $i++)
+	{
+	  my $t= $tests->[$i];
+
+	  if (run_testcase_check_skip_test($t)){
+	    # Move the test to completed list
+	    #mtr_report("skip - Moving test $i to completed");
+	    push(@$completed, splice(@$tests, $i, 1));
+	    redo; # Start over again
+	  }
+
+	  # Limit number of parallell NDB tests
+	  if ($t->{ndb_test} and $num_ndb_tests >= $max_ndb){
+	    #mtr_report("Skipping, num ndb is already at max, $num_ndb_tests");
+	    next;
+	  }
+
+	  # Prefer same configuration
+	  if (defined $result and
+	      $result->{template_path} eq $t->{template_path})
+	  {
+	    #mtr_report("Test uses same config => good match");
+	    # Test uses same config => good match
+	    $next= splice(@$tests, $i, 1);
+	    last;
+	  }
+
+	  # Second best choice is the first that does not fulfill
+	  # any of the above conditions
+	  if (!defined $second_best){
+	    #mtr_report("Setting second_best to $i");
+	    $second_best= $i;
+	  }
+	}
+
+	# Use second best choice if no other test has been found
+	if (!$next and defined $second_best){
+	  #mtr_report("Take second best choice $second_best");
+	  mtr_error("Internal error, second best too large")
+	    if $second_best >  $#$tests;
+	  $next= splice(@$tests, $second_best, 1);
+	}
+
+	if ($next) {
+	  #$next->print_test();
+	  $next->write_test($sock, 'TESTCASE');
+	  $running{$next->key()}= $next;
+	  $num_ndb_tests++ if ($next->{ndb_test});
+	}
+	else {
+	  # No more test, tell child to exit
+	  #mtr_report("Saying BYE to child");
+	  print $sock "BYE\n";
+	}
+      }
+    }
+
+    # ----------------------------------------------------
+    # Check if test suite timer expired
+    # ----------------------------------------------------
+    if ( ! $suite_timeout_proc->wait_one(0) )
+    {
+      mtr_report("Test suite timeout! Terminating...");
+      return undef;
+    }
+  }
+}
+
+
+sub run_worker ($) {
+  my ($server_port, $thread_num)= @_;
+
+  $SIG{INT}= sub { exit(1); };
+
+  report_option('name',"worker[$thread_num]");
+
+  # Connect to server
+  my $server = new IO::Socket::INET
+    (
+     PeerAddr => 'localhost',
+     PeerPort => $server_port,
+     Proto    => 'tcp'
+    );
+  mtr_error("Could not connect to server at port $server_port: $!")
+    unless $server;
+
+  # Read hello from server which it will send when shared
+  # resources have been setup
+  my $hello= <$server>;
+
+  command_line_setup($thread_num);
+
+  if ( $opt_gcov )
+  {
+    gcov_prepare();
+  }
+
+  setup_vardir();
+  mysql_install_db($thread_num);
+
   if ( using_extern() ) {
     create_config_file_for_extern(%opts_extern);
   }
 
-  run_tests($tests);
+  # Ask server for first test
+  print $server "START\n";
 
-  exit(0);
+  while(my $line= <$server>){
+    chomp($line);
+    if ($line eq 'TESTCASE'){
+      my $test= My::Test::read_test($server);
+      #$test->print_test();
+      run_testcase($test);
+      #$test->{result}= 'MTR_RES_PASSED';
+      # Send it back, now with results set
+      #$test->print_test();
+      $test->write_test($server, 'TESTRESULT');
+    }
+    elsif ($line eq 'BYE'){
+      mtr_report("Server said BYE");
+      exit(0);
+    }
+    else {
+      mtr_error("Could not understand server, '$line'");
+    }
+  }
+
+  stop_all_servers();
+
+  if ( $opt_gcov )
+  {
+    gcov_collect(); # collect coverage information
+  }
+
+  if ( $opt_gcov )
+  {
+    gcov_collect(); # collect coverage information
+  }
+
+  exit(1);
 }
 
 
 sub ignore_option {
   my ($opt, $value)= @_;
-  print "Ignoring option '$opt'\n";
+  mtr_report("Ignoring option '$opt'");
 }
 
 sub command_line_setup {
+  my ($thread_num)= @_;
+
   my $opt_comment;
   my $opt_usage;
 
-  # This is needed for test log evaluation in "gen-build-status-page"
-  # in all cases where the calling tool does not log the commands
-  # directly before it executes them, like "make test-force-pl" in RPM builds.
-  mtr_report("Logging: $0 ", join(" ", @ARGV));
+  # Default verbosity, server ON and workers OFF
+  report_option('verbose', $thread_num ?  undef : 0);
 
   # Read the command line options
   # Note: Keep list, and the order, in sync with usage at end of this file
@@ -335,7 +727,7 @@ sub command_line_setup {
 	     'skip-im'                  => \&ignore_option,
 
              # Specify ports
-	     'build-thread|mtr-build-thread=i' => \$opt_mtr_build_thread,
+	     'build-thread|mtr-build-thread=i' => \$opt_build_thread,
 
              # Test case authoring
              'record'                   => \$opt_record,
@@ -365,6 +757,7 @@ sub command_line_setup {
              'strace-client:s'          => \$opt_strace_client,
              'max-save-core=i'          => \$opt_max_save_core,
              'max-save-datadir=i'       => \$opt_max_save_datadir,
+             'max-test-fail=i'          => \$opt_max_test_fail,
 
              # Coverage, profiling etc
              'gcov'                     => \$opt_gcov,
@@ -398,10 +791,10 @@ sub command_line_setup {
              'report-features'          => \$opt_report_features,
              'comment=s'                => \$opt_comment,
              'fast'                     => \$opt_fast,
-             'reorder'                  => \&collect_option,
+             'reorder!'                 => \&collect_option,
              'enable-disabled'          => \&collect_option,
              'verbose+'                 => \$opt_verbose,
-             'verbose-restart'          => \$opt_verbose_restart,
+             'verbose-restart'          => \&report_option,
              'sleep=i'                  => \$opt_sleep,
              'start-dirty'              => \$opt_start_dirty,
              'start'                    => \$opt_start,
@@ -409,23 +802,32 @@ sub command_line_setup {
 	     'repeat=i'                 => \$opt_repeat,
 	     'retry=i'                  => \$opt_retry,
 	     'retry-failure=i'          => \$opt_retry_failure,
-             'timer!'                   => \$opt_timer,
+             'timer!'                   => \&report_option,
              'user=s'                   => \$opt_user,
              'testcase-timeout=i'       => \$opt_testcase_timeout,
              'suite-timeout=i'          => \$opt_suite_timeout,
              'shutdown-timeout=i'       => \$opt_shutdown_timeout,
              'warnings!'                => \$opt_warnings,
 	     'timestamp'                => \&report_option,
+	     'timediff'                 => \&report_option,
 
              'help|h'                   => \$opt_usage,
-            ) or usage("Can't read options");
+            ) or usage($thread_num, "Can't read options");
 
-  usage("") if $opt_usage;
+  usage($thread_num, "") if $opt_usage;
+
+  # --------------------------------------------------------------------------
+  # Setup verbosity
+  # --------------------------------------------------------------------------
+  if ($opt_verbose != 0){
+    report_option('verbose', $opt_verbose);
+  }
 
   # --------------------------------------------------------------------------
-  # Check mtr_build_thread and calculate baseport
+  # Check build_thread and calculate baseport
+  # Use auto build thread in all but first worker
   # --------------------------------------------------------------------------
-  set_mtr_build_thread_ports($opt_mtr_build_thread);
+  set_build_thread_ports($thread_num > 1 ? 'auto' : $opt_build_thread);
 
   if ( -d "../sql" )
   {
@@ -515,7 +917,7 @@ sub command_line_setup {
     }
     elsif ( $arg =~ /^-/ )
     {
-      usage("Invalid option \"$arg\"");
+      usage($thread_num, "Invalid option \"$arg\"");
     }
     else
     {
@@ -552,8 +954,9 @@ sub command_line_setup {
 
   # --------------------------------------------------------------------------
   # Check if we should speed up tests by trying to run on tmpfs
+  # - Dont check in workers
   # --------------------------------------------------------------------------
-  if ( defined $opt_mem )
+  if ( defined $opt_mem and $thread_num == 0)
   {
     mtr_error("Can't use --mem and --vardir at the same time ")
       if $opt_vardir;
@@ -569,7 +972,7 @@ sub command_line_setup {
     {
       if ( -d $fs )
       {
-	my $template= "var_${opt_mtr_build_thread}_XXXX";
+	my $template= "var_${opt_build_thread}_XXXX";
 	$opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0);
 	last;
       }
@@ -585,6 +988,11 @@ sub command_line_setup {
     $opt_vardir= $default_vardir;
   }
 
+  # If more than one parallel run, use a subdir of the selected var
+  if ($thread_num && $opt_parallel > 1) {
+    $opt_vardir.= "/".$thread_num;
+   }
+
   $path_vardir_trace= $opt_vardir;
   # Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/...
   $path_vardir_trace=~ s/^\w://;
@@ -606,6 +1014,11 @@ sub command_line_setup {
   $opt_tmpdir=       "$opt_vardir/tmp" unless $opt_tmpdir;
   $opt_tmpdir =~ s,/+$,,;       # Remove ending slash if any
 
+  # If more than one parallel run, use a subdir of the selected tmpdir
+  if ($thread_num && $opt_parallel > 1 and $opt_tmpdir ne "$opt_vardir/tmp") {
+    $opt_tmpdir.= "/".$thread_num;
+   }
+
   # --------------------------------------------------------------------------
   # fast option
   # --------------------------------------------------------------------------
@@ -683,6 +1096,11 @@ sub command_line_setup {
   }
 
   # --------------------------------------------------------------------------
+  # Set timeout values
+  # --------------------------------------------------------------------------
+  $opt_start_timeout*= $opt_parallel;
+
+  #
   # Check valgrind arguments
   # --------------------------------------------------------------------------
   if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args)
@@ -738,6 +1156,16 @@ sub command_line_setup {
   $path_testlog=         "$opt_vardir/log/mysqltest.log";
   $path_current_testlog= "$opt_vardir/log/current_test";
 
+  mtr_report("Checking supported features...");
+
+  check_ndbcluster_support(\%mysqld_variables);
+  check_ssl_support(\%mysqld_variables);
+  check_debug_support(\%mysqld_variables);
+
+  executable_setup();
+
+  environment_setup();
+
 }
 
 
@@ -756,19 +1184,20 @@ sub command_line_setup {
 # http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
 # But a fairly safe range seems to be 5001 - 32767
 #
-sub set_mtr_build_thread_ports($) {
-  my $mtr_build_thread= shift || 0;
+sub set_build_thread_ports($) {
+  my $build_thread= shift || 0;
 
-  if ( lc($mtr_build_thread) eq 'auto' ) {
-    print "Requesting build thread... ";
-    $mtr_build_thread=
+  if ( lc($build_thread) eq 'auto' ) {
+    mtr_report("Requesting build thread... ");
+    $build_thread=
       mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299);
-    print "got ".$mtr_build_thread."\n";
+    mtr_report(" - got $build_thread");
   }
-  $ENV{MTR_BUILD_THREAD}= $mtr_build_thread;
+  $ENV{MTR_BUILD_THREAD}= $build_thread;
+  $opt_build_thread= $build_thread;
 
   # Calculate baseport
-  $opt_baseport= $mtr_build_thread * 10 + 10000;
+  $opt_baseport= $build_thread * 10 + 10000;
   if ( $opt_baseport < 5001 or $opt_baseport + 9 >= 32767 )
   {
     mtr_error("MTR_BUILD_THREAD number results in a port",
@@ -776,7 +1205,7 @@ sub set_mtr_build_thread_ports($) {
               "($opt_baseport - $opt_baseport + 9)");
   }
 
-  mtr_report("Using MR_BUILD_THREAD $mtr_build_thread,",
+  mtr_report("Using MTR_BUILD_THREAD $build_thread,",
 	     "with reserved ports $opt_baseport..".($opt_baseport+9));
 
 }
@@ -1131,8 +1560,8 @@ sub environment_setup {
 
   $ENV{'UDF_EXAMPLE_LIB'}=
     ($lib_udf_example ? basename($lib_udf_example) : "");
-  $ENV{'UDF_EXAMPLE_LIB_OPT'}=
-    ($lib_udf_example ? "--plugin_dir=" . dirname($lib_udf_example) : "");
+  $ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
+    ($lib_udf_example ? dirname($lib_udf_example) : "");
 
   # --------------------------------------------------------------------------
   # Add the path where mysqld will find ha_example.so
@@ -1143,9 +1572,9 @@ sub environment_setup {
 		      "$basedir/storage/example/.libs/ha_example.so",);
     $ENV{'EXAMPLE_PLUGIN'}=
       ($lib_example_plugin ? basename($lib_example_plugin) : "");
-    $ENV{'EXAMPLE_PLUGIN_OPT'}=
-      ($lib_example_plugin ?
-       "--plugin_dir=" . dirname($lib_example_plugin) : "");
+    $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
+      ($lib_example_plugin ? dirname($lib_example_plugin) : "");
+
   }
 
   # --------------------------------------------------------------------------
@@ -1408,7 +1837,7 @@ sub remove_stale_vardir () {
 # Create var and the directories needed in var
 #
 sub setup_vardir() {
-  mtr_report("Creating var directory...");
+  mtr_report("Creating var directory '$opt_vardir'...");
 
   if ( $opt_vardir eq $default_vardir )
   {
@@ -1617,7 +2046,7 @@ sub ndbcluster_wait_started($$){
   mtr_init_args(\$args);
   mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
   mtr_add_arg($args, "--defaults-group-suffix=%s", $cluster->suffix());
-  mtr_add_arg($args, "--timeout=60");
+  mtr_add_arg($args, "--timeout=%d", $opt_start_timeout);
 
   if ($ndb_waiter_extra_opt)
   {
@@ -1796,76 +2225,6 @@ sub ndbcluster_start ($) {
 }
 
 
-#
-# Run the collected tests
-#
-my $suite_timeout_proc;
-sub run_tests {
-  my ($tests)= @_;
-
-  mtr_report();
-  mtr_print_thick_line();
-  mtr_print_header();
-
-  $suite_timeout_proc= My::SafeProcess->timer($opt_suite_timeout* 60);
-  foreach my $tinfo ( @$tests )
-  {
-    if (run_testcase_check_skip_test($tinfo))
-    {
-      next;
-    }
-
-    for my $repeat (1..$opt_repeat){
-
-      if (run_testcase($tinfo))
-      {
-	# Testcase failed, enter retry mode
-	my $retries= 1;
-	while ($retries < $opt_retry){
-	  mtr_report("\nRetrying, attempt($retries/$opt_retry)...\n");
-
-	  if (run_testcase($tinfo) <= 0)
-	  {
-	    # Testcase suceeded
-
-	    my $test_has_failed= $tinfo->{failures} || 0;
-	    if (!$test_has_failed){
-	      last;
-	    }
-	  }
-	  else
-	  {
-	    # Testcase failed
-
-	    # Limit number of test failures
-	    my $failures= $tinfo->{failures};
-	    if ($opt_retry > 1 and $failures >= $opt_retry_failure){
-	      mtr_report("Test has failed $failures times, no more retries!\n");
-	      last;
-	    }
-	  }
-	  $retries++;
-	}
-      }
-    }
-  }
-  # Kill the test suite timer
-  $suite_timeout_proc->kill();
-
-  mtr_print_line();
-
-  stop_all_servers();
-
-  if ( $opt_gcov )
-  {
-    gcov_collect(); # collect coverage information
-  }
-
-  mtr_report_stats($tests);
-
-}
-
-
 sub create_config_file_for_extern {
   my %opts=
     (
@@ -2013,7 +2372,7 @@ sub initialize_servers {
       remove_stale_vardir();
       setup_vardir();
 
-      mysql_install_db();
+      mysql_install_db(0);
     }
   }
   check_running_as_root();
@@ -2070,6 +2429,7 @@ sub sql_to_bootstrap {
 
 
 sub mysql_install_db {
+  my ($thread_num)= @_;
   my $data_dir= "$opt_vardir/install.db";
 
   mtr_report("Installing system database...");
@@ -2112,6 +2472,8 @@ sub mysql_install_db {
   # ----------------------------------------------------------------------
   $ENV{'MYSQLD_BOOTSTRAP_CMD'}= "$exe_mysqld_bootstrap " . join(" ", @$args);
 
+  return if $thread_num > 0; # Only generate MYSQLD_BOOTSTRAP_CMD in workers
+
   # ----------------------------------------------------------------------
   # Create the bootstrap.sql file
   # ----------------------------------------------------------------------
@@ -2270,25 +2632,111 @@ sub do_before_run_mysqltest($)
 }
 
 
+#
+# Check all server for sideffects
+#
+# RETURN VALUE
+#  0 ok
+#  1 Check failed
+#  >1 Fatal errro
+
 sub check_testcase($$)
 {
   my ($tinfo, $mode)= @_;
-  my $result;
+  my $tname= $tinfo->{name};
 
-  # Parallell( mysqlds(), run_check_testcase, check_testcase_failed );
+  # Start the mysqltest processes in parallel to save time
+  # also makes it possible to wait for any process to exit during the check
+  my %started;
   foreach my $mysqld ( mysqlds() )
   {
     if ( defined $mysqld->{'proc'} )
     {
-      if (run_check_testcase($tinfo, $mode, $mysqld))
+      my $proc= start_check_testcase($tinfo, $mode, $mysqld);
+      $started{$proc->pid()}= $proc;
+    }
+  }
+
+  # Return immediately if no check proceess was started
+  return 0 unless ( keys %started );
+
+  while (1){
+    my $result;
+    my $proc= My::SafeProcess->wait_any();
+    mtr_report("Got $proc");
+
+    if ( delete $started{$proc->pid()} ) {
+
+      my $err_file= $proc->user_data();
+      my $base_file= mtr_match_extension($err_file, "err"); # Trim extension
+
+      # One check testcase process returned
+      my $res= $proc->exit_status();
+
+      if ( $res == 0){
+	# Check completed without problem
+
+	# Remove the .err file the check generated
+	unlink($err_file);
+
+	# Remove the .result file the check generated
+	if ( $mode eq 'after' ){
+	  unlink("$base_file.result");
+	}
+
+	if ( keys(%started) == 0){
+	  # All checks completed
+	  return 0;
+	}
+	# Wait for next process to exit
+	next;
+      }
+      else
       {
-	# Check failed, mark the test case with that info
-	$tinfo->{'check_testcase_failed'}= 1;
-	$result= 1;
+	if ( $mode eq "after" and $res == 1 )
+	{
+	  # Test failed, grab the report mysqltest has created
+	  my $report= mtr_grab_file($err_file);
+	  $tinfo->{check}.=
+	    "\nThe check of testcase '$tname' failed, this is the\n".
+	      "diff between before and after:\n";
+	  $tinfo->{check}.= $report;
+
+	  # Check failed, mark the test case with that info
+	  $tinfo->{'check_testcase_failed'}= 1;
+	  $result= 1;
+	}
+	elsif ( $res )
+	{
+	  my $report= mtr_grab_file($err_file);
+	  $tinfo->{comment}.=
+	    "Could not execute 'check-testcase' $mode testcase '$tname':\n";
+	  $tinfo->{comment}.= $report;
+
+	  $result= 2;
+	}
+
+	# Remove the .err file the check generated
+	unlink($err_file);
+
+	# Remove the .result file the check generated
+	unlink("$base_file.result");
+
       }
     }
+    else {
+      # Unknown process returned, most likley a crash, abort everything
+      $tinfo->{comment}=
+	"Unexpected process $proc returned during ".
+	"check testcase $mode test";
+      $result= 3;
+    }
+
+    # Kill any check processes still running
+    map($_->kill(), values(%started));
+
+    return $result;
   }
-  return $result;
 }
 
 
@@ -2439,16 +2887,15 @@ sub run_testcase ($) {
   # ----------------------------------------------------------------------
   if ( $opt_start or $opt_start_dirty )
   {
-    $suite_timeout_proc->kill();
-    mtr_report("\nStarted", started(all_servers()));
-    mtr_report("Waiting for server(s) to exit...");
+    mtr_print("\nStarted", started(all_servers()));
+    mtr_print("Waiting for server(s) to exit...");
     my $proc= My::SafeProcess->wait_any();
     if ( grep($proc eq $_, started(all_servers())) )
     {
-      mtr_report("Server $proc died");
+      mtr_print("Server $proc died");
       exit(1);
     }
-    mtr_report("Unknown process $proc died");
+    mtr_print("Unknown process $proc died");
     exit(1);
   }
 
@@ -2456,9 +2903,14 @@ sub run_testcase ($) {
 
   do_before_run_mysqltest($tinfo);
 
-  if ( $opt_check_testcases )
-  {
-    check_testcase($tinfo, "before")
+  if ( $opt_check_testcases and check_testcase($tinfo, "before") ){
+    # Failed to record state of server or server crashed
+    report_failure_and_restart($tinfo);
+
+    # Stop the test case timer
+    $test_timeout_proc->kill();
+
+    return 1;
   }
 
   my $test= start_mysqltest($tinfo);
@@ -2492,15 +2944,23 @@ sub run_testcase ($) {
 	}
 	else
 	{
-	  mtr_report_test_passed($tinfo, $opt_timer);
+	  mtr_report_test_passed($tinfo);
 	}
 
-	if ( $opt_check_testcases and check_testcase($tinfo, "after"))
+	my $check_res;
+	if ( $opt_check_testcases and
+	     $check_res= check_testcase($tinfo, "after"))
 	{
-	  # Stop all servers that are known to be running
-	  stop_all_servers();
-	  clean_datadir();
-	  mtr_report("Resuming tests...\n");
+	  if ($check_res == 1) {
+	    # Test case had sideeffects, not fatal error, just continue
+	    stop_all_servers();
+	    mtr_report("Resuming tests...\n");
+	  }
+	  else {
+	    # Test case check failed fatally, probably a server crashed
+	    report_failure_and_restart($tinfo);
+	    return 1;
+	  }
 	}
       }
       elsif ( $res == 62 )
@@ -2584,15 +3044,6 @@ sub run_testcase ($) {
       return 1;
     }
 
-    # ----------------------------------------------------
-    # Check if test suite timer expired
-    # ----------------------------------------------------
-    if ( $proc eq $suite_timeout_proc )
-    {
-      mtr_report("Test suite timeout! Terminating...");
-      exit(1);
-    }
-
     mtr_error("Unhandled process $proc exited");
   }
   mtr_error("Should never come here");
@@ -2605,7 +3056,7 @@ sub run_testcase ($) {
 #  0 OK
 #  1 Check failed
 #
-sub run_check_warnings ($$) {
+sub start_check_warnings ($$) {
   my $tinfo=    shift;
   my $mysqld=   shift;
 
@@ -2640,37 +3091,17 @@ sub run_check_warnings ($$) {
   }
 
   my $errfile= "$opt_vardir/tmp/$name.err";
-  my $res= My::SafeProcess->run
+  my $proc= My::SafeProcess->new
     (
      name          => $name,
      path          => $exe_mysqltest,
      error         => $errfile,
      output        => $errfile,
      args          => \$args,
+     user_data     => $errfile,
     );
-
-  if ( $res == 0 )
-  {
-    my $report= mtr_grab_file($errfile);
-    # Log to var/log/warnings file
-    mtr_tofile("$opt_vardir/log/warnings",
-               $tname."\n",
-               $report);
-
-    $res= 1;
-    $tinfo->{'warnings'}.= $report;
-  }
-  elsif ( $res == 62 ) {
-    # Test case was ok and called "skip"
-    $res= 0;
-  }
-  elsif ( $res )
-  {
-    mtr_report("\nCould not execute 'check-warnings' for testcase '$tname':");
-    mtr_printfile($errfile);
-    $res= 0; # Ignore error
-  }
-  return $res;
+  mtr_verbose("Started $proc");
+  return $proc;
 }
 
 
@@ -2682,17 +3113,94 @@ sub check_warnings ($) {
   my ($tinfo)= @_;
   my $res= 0;
 
+  my $tname= $tinfo->{name};
+
   # Clear previous warnings
-  $tinfo->{warnings}= undef;
+  delete($tinfo->{warnings});
 
-  # Parallell( mysqlds(), run_check_warning, check_warning_failed);
+  # Start the mysqltest processes in parallel to save time
+  # also makes it possible to wait for any process to exit during the check
+  my %started;
   foreach my $mysqld ( mysqlds() )
   {
-    if (run_check_warnings($tinfo, $mysqld)){
-      $res= 1;
-      mtr_report();
+    if ( defined $mysqld->{'proc'} )
+    {
+      my $proc= start_check_warnings($tinfo, $mysqld);
+      $started{$proc->pid()}= $proc;
     }
   }
+
+  # Return immediately if no check proceess was started
+  return 0 unless ( keys %started );
+
+  while (1){
+    my $result= 0;
+    my $proc= My::SafeProcess->wait_any();
+    mtr_report("Got $proc");
+
+    if ( delete $started{$proc->pid()} ) {
+      # One check warning process returned
+      my $res= $proc->exit_status();
+      my $err_file= $proc->user_data();
+
+      if ( $res == 0 or $res == 62 ){
+
+	if ( $res == 0 ) {
+	  # Check completed with problem
+	  my $report= mtr_grab_file($err_file);
+	  # Log to var/log/warnings file
+	  mtr_tofile("$opt_vardir/log/warnings",
+		     $tname."\n".$report);
+
+	  $tinfo->{'warnings'}.= $report;
+	  $result= 1;
+	}
+
+	if ( $res == 62 ) {
+	  # Test case was ok and called "skip"
+	  ;
+	}
+	# Remove the .err file the check generated
+	unlink($err_file);
+
+	if ( keys(%started) == 0){
+	  # All checks completed
+	  return $result;
+	}
+	# Wait for next process to exit
+	next;
+      }
+      else
+      {
+	my $report= mtr_grab_file($err_file);
+	$tinfo->{comment}.=
+	  "Could not execute 'check-warnings' for testcase '$tname':";
+	$tinfo->{comment}.= $report;
+
+	$result= 2;
+      }
+      # Remove the .err file the check generated
+      unlink($err_file);
+    }
+    else {
+      # Unknown process returned, most likley a crash, abort everything
+      $tinfo->{comment}=
+	"Unexpected process $proc returned during ".
+	"check warnings";
+      $result= 3;
+    }
+
+    # Kill any check processes still running
+    map($_->kill(), values(%started));
+
+    return $result;
+  }
+
+
+
+
+  return $res;
+
   return $res;
 }
 
@@ -2747,10 +3255,41 @@ sub check_expected_crash_and_restart {
 }
 
 
+# Remove all files and subdirectories of a directory
+sub clean_dir {
+  my ($dir)= @_;
+  mtr_verbose("clean_dir: $dir");
+  finddepth(
+	  { no_chdir => 1,
+	    wanted => sub {
+	      if (-d $_){
+		# A dir
+		if ($_ eq $dir){
+		  # The dir to clean
+		  return;
+		} else {
+		  mtr_verbose("rmdir: '$_'");
+		  rmdir($_) or mtr_warning("rmdir($_) failed: $!");
+		}
+	      } else {
+		# Hopefully a file
+		mtr_verbose("unlink: '$_'");
+		unlink($_) or mtr_warning("unlink($_) failed: $!");
+	      }
+	    }
+	  },
+	    $dir);
+}
+
+
 sub clean_datadir {
 
   mtr_verbose("Cleaning datadirs...");
 
+  if (started(all_servers()) != 0){
+    mtr_error("Trying to clean datadir before all servers stopped");
+  }
+
   foreach my $cluster ( clusters() )
   {
     my $cluster_dir= "$opt_vardir/".$cluster->{name};
@@ -2769,55 +3308,22 @@ sub clean_datadir {
   }
 
   # Remove all files in tmp and var/tmp
-  rmtree("$opt_vardir/tmp");
-  mkpath("$opt_vardir/tmp");
+  clean_dir("$opt_vardir/tmp");
   if ($opt_tmpdir ne "$opt_vardir/tmp"){
-    rmtree($opt_tmpdir);
-    mkpath($opt_tmpdir);
+    clean_dir($opt_tmpdir);
   }
 }
 
 
 #
-# Limit number of core files saved
-#
-sub limit_cores_after_failure ($) {
-  my ($datadir)= @_;
-
-  # Look for core files
-  foreach my $core_file ( glob("$datadir/core*") )
-  {
-    my $core_name= basename($core_file);
-    if ($opt_max_save_core > 0 && $num_saved_cores >= $opt_max_save_core) {
-      # Delete file to avoid saving it  when the datadir is later saved
-      mtr_report(" - deleting '$core_name'",
-		 "($num_saved_cores/$opt_max_save_core)");
-      unlink("$core_file");
-    }
-    else {
-      mtr_report(" - found '$core_name'",
-		 "($num_saved_cores/$opt_max_save_core)");
-    }
-    ++$num_saved_cores;
-  }
-}
-
-#
 # Save datadir before it's removed
 #
 sub save_datadir_after_failure($$) {
   my ($dir, $savedir)= @_;
 
-  if ($opt_max_save_datadir > 0 &&
-      $num_saved_datadir >= $opt_max_save_datadir)
-  {
-    mtr_report(" - skipping '$dir'");
-  }
-  else {
-    mtr_report(" - saving '$dir'");
-    my $dir_name= basename($dir);
-    rename("$dir", "$savedir/$dir_name");
-  }
+  mtr_report(" - saving '$dir'");
+  my $dir_name= basename($dir);
+  rename("$dir", "$savedir/$dir_name");
 }
 
 
@@ -2832,19 +3338,19 @@ sub after_failure ($) {
   $save_dir.= "-$tinfo->{combination}"
     if defined $tinfo->{combination};
 
+  # Save savedir  path for server
+  $tinfo->{savedir}= $save_dir;
+
   mkpath($save_dir) if ! -d $save_dir;
 
   # Save the used my.cnf file
   copy($path_config_file, $save_dir);
 
+  # Copy the tmp dir
+  copytree("$opt_vardir/tmp/", "$save_dir/tmp/");
+
   if ( clusters() ) {
     foreach my $cluster ( clusters() ) {
-
-      foreach my $server ( ndbds($cluster), ndb_mgmds($cluster) ) {
-	my $data_dir= $server->value('DataDir');
-	limit_cores_after_failure($data_dir);
-      }
-
       my $cluster_dir= "$opt_vardir/".$cluster->{name};
       save_datadir_after_failure($cluster_dir, $save_dir);
     }
@@ -2852,33 +3358,43 @@ sub after_failure ($) {
   else {
     foreach my $mysqld ( mysqlds() ) {
       my $data_dir= $mysqld->value('datadir');
-      limit_cores_after_failure($data_dir);
       save_datadir_after_failure(dirname($data_dir), $save_dir);
     }
   }
-
-  $num_saved_datadir++;
-
-  clean_datadir();
 }
 
 
 sub report_failure_and_restart ($) {
   my $tinfo= shift;
 
-  mtr_report_test_failed($tinfo, $path_current_testlog);
-  print "\n";
-  if ( $opt_force )
-  {
-    # Stop all servers that are known to be running
-    stop_all_servers();
+  stop_all_servers();
 
-    after_failure($tinfo);
-    mtr_report("Resuming tests...\n");
-    return;
+  $tinfo->{'result'}= 'MTR_RES_FAILED';
+
+  my $test_failures= $tinfo->{'failures'} || 0;
+  $tinfo->{'failures'}=  $test_failures + 1;
+
+
+  my $logfile= $path_current_testlog;
+  if ( $tinfo->{comment} )
+  {
+    # The test failure has been detected by mysql-test-run.pl
+    # when starting the servers or due to other error, the reason for
+    # failing the test is saved in "comment"
+    ;
+  }
+  elsif ( defined $logfile and -f $logfile )
+  {
+    # Test failure was detected by test tool and its report
+    # about what failed has been saved to file. Save the report
+    # in tinfo
+    $tinfo->{logfile}= mtr_fromfile($logfile);
   }
-  mtr_error("Test '$tinfo->{'name'}' failed.",
-	    "To continue, re-run with '--force'");
+
+  after_failure($tinfo);
+
+  mtr_report_test($tinfo);
+
 }
 
 
@@ -3106,7 +3622,7 @@ sub mysqld_start ($$) {
 
 sub stop_all_servers () {
 
-  mtr_report("Stopping all servers...");
+  mtr_verbose("Stopping all servers...");
 
   # Kill all started servers
   My::SafeProcess::shutdown(0, # shutdown timeout 0 => kill
@@ -3273,12 +3789,32 @@ sub started { return grep(defined $_, ma
 sub stopped { return grep(!defined $_, map($_->{proc}, @_)); }
 
 
+sub envsubst {
+  my $string= shift;
+
+  if ( ! defined $ENV{$string} )
+  {
+    mtr_error(".opt file references '$string' which is not set");
+  }
+
+  return $ENV{$string};
+}
+
+
 sub get_extra_opts {
   my ($mysqld, $tinfo)= @_;
 
-  return
+  my $opts=
     $mysqld->option("#!use-slave-opt") ?
       $tinfo->{slave_opt} : $tinfo->{master_opt};
+
+  # Expand environment variables
+  foreach my $opt ( @$opts )
+  {
+    $opt =~ s/\$\{(\w+)\}/envsubst($1)/ge;
+    $opt =~ s/\$(\w+)/envsubst($1)/ge;
+  }
+  return $opts;
 }
 
 
@@ -3382,9 +3918,18 @@ sub start_servers($) {
     }
 
     # Copy datadir from installed system db
-    copytree("$opt_vardir/install.db", $datadir)
+    for my $path ( "$opt_vardir", "$opt_vardir/..") {
+      my $install_db= "$path/install.db";
+      copytree($install_db, $datadir)
+	if -d $install_db;
+    }
+    mtr_error("Failed to copy system db to '$datadir'")
       unless -d $datadir;
 
+    # Create the servers tmpdir
+    my $tmpdir= $mysqld->value('tmpdir');
+    mkpath($tmpdir) unless -d $tmpdir;
+
     # Write start of testcase to log file
     mark_log($mysqld->value('log-error'), $tinfo);
 
@@ -3449,10 +3994,9 @@ sub start_servers($) {
 # After testcase, run and compare with the recorded file, they should be equal!
 #
 # RETURN VALUE
-#  0 OK
-#  1 Check failed
+#  The newly started process
 #
-sub run_check_testcase ($$$) {
+sub start_check_testcase ($$$) {
   my $tinfo=    shift;
   my $mode=     shift;
   my $mysqld=   shift;
@@ -3477,28 +4021,17 @@ sub run_check_testcase ($$$) {
     mtr_add_arg($args, "--record");
   }
   my $errfile= "$opt_vardir/tmp/$name.err";
-  my $res= My::SafeProcess->run
+  my $proc= My::SafeProcess->new
     (
      name          => $name,
      path          => $exe_mysqltest,
      error         => $errfile,
      args          => \$args,
+     user_data     => $errfile,
     );
 
-  if ( $mode eq "after" and $res == 1 )
-  {
-    mtr_report("\nThe check of testcase '$tname' failed, this is the\n",
-	       "diff between before and after:\n");
-    # Test failed, display the report mysqltest has created
-    mtr_printfile($errfile);
-  }
-  elsif ( $res )
-  {
-    mtr_report("\nCould not execute 'check-testcase' $mode testcase '$tname':");
-    mtr_printfile($errfile);
-    mtr_report();
-  }
-  return $res;
+  mtr_report("Started $proc");
+  return $proc;
 }
 
 
@@ -3556,10 +4089,7 @@ sub start_mysqltest ($) {
     mtr_add_arg($args, "$exe_mysqltest");
   }
 
-  if ( $opt_timer )
-  {
-    mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir);
-  }
+  mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir);
 
   if ( $opt_compress )
   {
@@ -3884,7 +4414,10 @@ sub valgrind_arguments {
 # Usage
 #
 sub usage ($) {
-  my $message= shift;
+  my ($thread_num, $message)= @_;
+
+  # Only main thread should print usage
+  return if $thread_num != 0;
 
   if ( $message )
   {
@@ -4008,6 +4541,10 @@ Options for debugging the product
                         up disks for heavily crashing server). Defaults to
                         $opt_max_save_datadir, set to 0 for no limit. Set
                         it's default with MTR_MAX_SAVE_DATDIR
+  max-test-fail         Limit the number of test failurs before aborting
+                        the current test run. Defaults to
+                        $opt_max_test_fail, set to 0 for no limit. Set
+                        it's default with MTR_MAX_TEST_FAIL
 
 Options for valgrind
 

=== modified file 'mysql-test/r/character_set_database_func.result'
--- a/mysql-test/r/character_set_database_func.result	2008-04-14 15:21:18 +0000
+++ b/mysql-test/r/character_set_database_func.result	2008-05-30 09:12:07 +0000
@@ -59,14 +59,14 @@ USE test;
 CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
 'Verify with latin';
 SET @@session.character_set_database = latin1;
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
 SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
 count(*)
 2433
 TRUNCATE TABLE t1;
 'Verify with utf8';
 SET @@session.character_set_database = utf8;
-LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/charset_utf8.txt' INTO TABLE t1;
 SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
 count(*)
 1

=== modified file 'mysql-test/r/func_time.result'
--- a/mysql-test/r/func_time.result	2008-03-12 10:54:23 +0000
+++ b/mysql-test/r/func_time.result	2008-07-28 17:08:56 +0000
@@ -1078,6 +1078,7 @@ Note	1003	select timestampdiff(WEEK,'200
 select time_format('100:00:00', '%H %k %h %I %l');
 time_format('100:00:00', '%H %k %h %I %l')
 100 100 04 04 4
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
 SET GLOBAL log_bin_trust_function_creators = 1;
 create table t1 (a timestamp default '2005-05-05 01:01:01',
 b timestamp default '2005-05-05 01:01:01');
@@ -1121,6 +1122,7 @@ call t_sysdate();
 @a != @b
 1
 drop procedure t_sysdate;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
 select timestampdiff(month,'2004-09-11','2004-09-11');
 timestampdiff(month,'2004-09-11','2004-09-11')
 0

=== modified file 'mysql-test/r/grant.result'
--- a/mysql-test/r/grant.result	2008-06-10 22:27:52 +0000
+++ b/mysql-test/r/grant.result	2008-07-28 17:08:56 +0000
@@ -1,3 +1,4 @@
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
 SET GLOBAL log_bin_trust_function_creators = 1;
 drop table if exists t1;
 drop database if exists mysqltest;
@@ -1351,4 +1352,4 @@ DROP PROCEDURE sp3;
 DROP USER 'userbug33464'@'localhost';
 use test;
 DROP DATABASE dbbug33464;
-End of 5.1 tests
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;

=== modified file 'mysql-test/r/grant2.result'
--- a/mysql-test/r/grant2.result	2008-03-18 10:54:37 +0000
+++ b/mysql-test/r/grant2.result	2008-07-28 17:08:56 +0000
@@ -365,6 +365,7 @@ insert into mysql.user select * from t1;
 drop table t1, t2;
 drop database TESTDB;
 flush privileges;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
 SET GLOBAL log_bin_trust_function_creators = 1;
 grant all privileges on test.* to `a@`@localhost;
 grant execute on * to `a@`@localhost;
@@ -380,7 +381,7 @@ drop function f2;
 drop table t2;
 REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
 drop user `a@`@localhost;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
 drop database if exists mysqltest_1;
 drop database if exists mysqltest_2;
 drop user mysqltest_u1@localhost;

=== modified file 'mysql-test/r/innodb_max_dirty_pages_pct_func.result'
--- a/mysql-test/r/innodb_max_dirty_pages_pct_func.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/innodb_max_dirty_pages_pct_func.result	2008-07-06 17:14:41 +0000
@@ -1,4 +1,5 @@
 '#--------------------FN_DYNVARS_044_02-------------------------#'
+SET @old_innodb_max_dirty_pages_pct= @@global.innodb_max_dirty_pages_pct;
 SET @@global.innodb_max_dirty_pages_pct = 80;
 'connect (con1,localhost,root,,,,)'
 'connection con1'
@@ -28,3 +29,5 @@ DROP PROCEDURE add_records;
 DROP PROCEDURE add_until;
 DROP PROCEDURE check_pct;
 DROP FUNCTION dirty_pct;
+DROP TABLE t1;
+SET @@global.innodb_max_dirty_pages_pct = @old_innodb_max_dirty_pages_pct;

=== modified file 'mysql-test/r/innodb_notembedded.result'
--- a/mysql-test/r/innodb_notembedded.result	2006-11-17 20:30:28 +0000
+++ b/mysql-test/r/innodb_notembedded.result	2008-07-10 16:09:39 +0000
@@ -1,4 +1,5 @@
 drop table if exists t1;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
 SET GLOBAL log_bin_trust_function_creators = 1;
 create table t1 (col1 integer primary key, col2 integer) engine=innodb;
 insert t1 values (1,100);
@@ -19,4 +20,4 @@ rollback;
 rollback;
 drop table t1;
 drop function f1;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;

=== modified file 'mysql-test/r/loaddata.result'
--- a/mysql-test/r/loaddata.result	2008-06-10 22:27:52 +0000
+++ b/mysql-test/r/loaddata.result	2008-07-28 17:08:56 +0000
@@ -212,7 +212,7 @@ set @@secure_file_priv= 0;
 ERROR HY000: Variable 'secure_file_priv' is a read only variable
 truncate table t1;
 load data infile 'MYSQL_TEST_DIR/t/loaddata.test' into table t1;
-ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+Got one of the listed errors
 select * from t1;
 a	b	c
 select load_file("MYSQL_TEST_DIR/t/loaddata.test");

=== modified file 'mysql-test/r/log_bin_trust_function_creators_func.result'
--- a/mysql-test/r/log_bin_trust_function_creators_func.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/log_bin_trust_function_creators_func.result	2008-07-10 16:09:39 +0000
@@ -3,6 +3,7 @@ drop table if exists t1;
 ## Creating new user tt ##
 CREATE user tt@localhost;
 ## Setting value of variable to 0 ##
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
 SET @@global.log_bin_trust_function_creators = 0;
 ## Creating new table t2 ##
 create table t2 (a INT);
@@ -69,3 +70,5 @@ drop function f1;
 ## Dropping table t1 & t2 ##
 drop table t1,t2;
 ## Disconnecting both the connections ##
+DROP USER tt@localhost;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;

=== modified file 'mysql-test/r/mysqlbinlog_base64.result'
--- a/mysql-test/r/mysqlbinlog_base64.result	2007-12-12 17:19:24 +0000
+++ b/mysql-test/r/mysqlbinlog_base64.result	2008-07-28 07:15:20 +0000
@@ -1,3 +1,4 @@
+reset master;
 create table t1 (a int);
 insert into t1 values (1);
 insert into t1 values (2);

=== modified file 'mysql-test/r/query_cache.result'
--- a/mysql-test/r/query_cache.result	2008-07-22 14:16:22 +0000
+++ b/mysql-test/r/query_cache.result	2008-07-28 17:08:56 +0000
@@ -1066,12 +1066,13 @@ create procedure `p1`()
 begin
 select a, f1() from t1;
 end//
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
 SET GLOBAL log_bin_trust_function_creators = 1;
 call p1()//
 a	f1()
 1	2
 2	2
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET GLOBAL log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
 drop procedure p1//
 drop function f1//
 drop table t1//

=== modified file 'mysql-test/r/query_cache_notembedded.result'
--- a/mysql-test/r/query_cache_notembedded.result	2007-10-16 13:05:05 +0000
+++ b/mysql-test/r/query_cache_notembedded.result	2008-07-28 17:08:56 +0000
@@ -315,6 +315,7 @@ drop procedure f2;
 drop procedure f3;
 drop procedure f4;
 drop table t1;
+SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
 SET GLOBAL log_bin_trust_function_creators = 1;
 reset query cache;
 drop function if exists f1;
@@ -347,7 +348,7 @@ id
 drop table t1;
 drop function f1;
 set GLOBAL query_cache_size=0;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
 DROP DATABASE IF EXISTS bug30269;
 FLUSH STATUS;
 CREATE DATABASE bug30269;

=== modified file 'mysql-test/r/rpl_max_binlog_size_func.result'
--- a/mysql-test/r/rpl_max_binlog_size_func.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/rpl_max_binlog_size_func.result	2008-05-30 09:12:07 +0000
@@ -1,5 +1,8 @@
 DROP TABLE IF EXISTS t1;
 '--- check if log file is rotated after 4096 bytes ----' 
+SET @saved_max_binlog_size= @@global.max_binlog_size;
 SET @@global.max_binlog_size = 4096;
 CREATE TABLE t1(a CHAR(5));
 'mylog.000002 exists'
+SET @@global.max_binlog_size= @saved_max_binlog_size;
+DROP TABLE t1;

=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result	2008-07-22 14:16:22 +0000
+++ b/mysql-test/r/subselect.result	2008-07-28 17:08:56 +0000
@@ -1656,6 +1656,18 @@ SELECT DISTINCT (SELECT a) FROM t1 LIMIT
 4
 5
 DROP TABLE t1;
+|<<<<<<< TREE
+|=======
+create table t1 (a int, b decimal(13, 3));
+insert into t1 values (1, 0.123);
+select a, (select max(b) from t1) into outfile "../../tmp/subselect.out.file.1" from t1;
+delete from t1;
+load data infile "../../tmp/subselect.out.file.1" into table t1;
+select * from t1;
+a	b
+1	0.123
+drop table t1;
+|>>>>>>> MERGE-SOURCE
 CREATE TABLE `t1` (
 `id` int(11) NOT NULL auto_increment,
 `id_cns` tinyint(3) unsigned NOT NULL default '0',

=== modified file 'mysql-test/r/timezone2.result'
--- a/mysql-test/r/timezone2.result	2007-03-09 10:12:31 +0000
+++ b/mysql-test/r/timezone2.result	2008-07-10 16:09:39 +0000
@@ -269,6 +269,7 @@ select * from t1;
 convert_tz(NULL, NULL, NULL)
 NULL
 drop table t1;
+SET @old_log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
 SET GLOBAL log_bin_trust_function_creators = 1;
 create table t1 (ldt datetime, udt datetime);
 create function f1(i datetime) returns datetime
@@ -284,7 +285,7 @@ ldt	ldt2
 2006-04-19 16:30:00	2006-04-19 16:30:00
 drop table t1;
 drop function f1;
-SET GLOBAL log_bin_trust_function_creators = 0;
+SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 (t TIMESTAMP);
 INSERT INTO t1 VALUES (NULL), (NULL);

=== modified file 'mysql-test/r/wait_timeout_func.result'
--- a/mysql-test/r/wait_timeout_func.result	2008-04-10 13:14:28 +0000
+++ b/mysql-test/r/wait_timeout_func.result	2008-07-06 17:07:30 +0000
@@ -6,6 +6,7 @@ id INT NOT NULL auto_increment,
 PRIMARY KEY (id),
 name VARCHAR(30)
 );
+SET @old_wait_timeout = @@global.wait_timeout;
 '#--------------------FN_DYNVARS_186_01-------------------------#'
 ## Creating new connection test_con1 ## 
 ## Setting value of variable to 5 ##
@@ -25,6 +26,8 @@ SET @@global.wait_timeout = 1;
 ## Creating new connection ## 
 INSERT into t1(name) values('Record_3');
 ## Using sleep to check timeout ##
-## We cannot test it further because the server stops due to wait_timeout ## 
+## We cannot test it further because the server closes the connection due to wait_timeout ## 
 SELECT * from t1;
 ERROR HY000: MySQL server has gone away
+DROP TABLE t1;
+SET @@global.wait_timeout = @old_wait_timeout;

=== renamed file 'mysql-test/suite/rpl/data/rpl_bug28618.dat' => 'mysql-test/std_data/rpl_bug28618.dat'
=== renamed file 'mysql-test/suite/rpl/data/rpl_mixed.dat' => 'mysql-test/std_data/rpl_mixed.dat'
=== modified file 'mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test'
--- a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test	2008-04-03 19:40:10 +0000
+++ b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test	2008-07-10 16:09:39 +0000
@@ -51,6 +51,6 @@ enable_warnings;
 remove_file $MYSQLD_DATADIR/slave-relay-bin.000001;
 remove_file $MYSQLD_DATADIR/slave-relay-bin.index;
 stop slave sql_thread;
-let $keep_connection=1;
+let $slave_keep_connection=1;
 source include/wait_for_slave_sql_to_stop.inc;
 

=== modified file 'mysql-test/suite/federated/federated_bug_25714.test'
--- a/mysql-test/suite/federated/federated_bug_25714.test	2008-06-10 22:27:52 +0000
+++ b/mysql-test/suite/federated/federated_bug_25714.test	2008-07-28 17:08:56 +0000
@@ -5,7 +5,10 @@ if (`select LENGTH("$MYSQL_BUG25714") = 
 {
   skip Need bug25714 test program;
 }
+|<<<<<<< TREE
 
+|=======
+|>>>>>>> MERGE-SOURCE
 connection default;
 
 # Disable concurrent inserts to avoid test failures when reading
@@ -54,8 +57,8 @@ DROP TABLE federated.t1;
 connection slave;
 DROP TABLE federated.t1;
 
+
 source federated_cleanup.inc;
 
 connection default;
-
 SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;

=== renamed file 'mysql-test/include/have_federated_db.inc' => 'mysql-test/suite/federated/have_federated_db.inc'
=== modified file 'mysql-test/suite/parts/inc/partition_layout_check1.inc'
--- a/mysql-test/suite/parts/inc/partition_layout_check1.inc	2008-07-22 14:16:22 +0000
+++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc	2008-07-28 17:08:56 +0000
@@ -1,12 +1,12 @@
 ################################################################################
-# inc/partition_layout_check1.inc                                              #
+# inc/partition_layout_check1.inc                                          #
 #                                                                              #
 # Purpose:                                                                     #
 #   Store the SHOW CREATE TABLE output and the list of files belonging to      #
 #   this table + print this into the protocol                                  #
 #   This script is only usefule when sourced within the partitioning tests.    #
 #                                                                              #
-# Attention: The routine inc/partition_layout_check2.inc is very similar       #
+# Attention: The routine inc/partition_layout_check2.inc is very similar   #
 #            to this one. So if something has to be changed here it            #
 #            might be necessary to do it also there                            #
 #                                                                              #
@@ -39,6 +39,7 @@ let $show_file= $MYSQLD_DATADIR/test/tmp
 --exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $show_file 2>&1 || true
 if ($do_file_tests)
 {
+|<<<<<<< TREE
   # List the files belonging to the table t1
   let $ls_file= $MYSQLD_DATADIR/test/tmp2;
   --list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
@@ -49,6 +50,18 @@ if ($do_file_tests)
     --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
   }
   eval SET @aux = load_file('$ls_file');
+|=======
+# List the files belonging to the table t1
+let $ls_file= $MYSQLD_DATADIR/test/tmp2;
+let $err_file= $MYSQLD_DATADIR/test/err2;
+--exec ls $MYSQLD_DATADIR/test/t1* > $ls_file 2>$err_file || true
+if ($with_directories)
+{
+--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true
+--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true
+}
+eval SET @aux = load_file('$ls_file');
+|>>>>>>> MERGE-SOURCE
 }
 if (!$do_file_tests)
 {

=== modified file 'mysql-test/suite/parts/inc/partition_layout_check2.inc'
--- a/mysql-test/suite/parts/inc/partition_layout_check2.inc	2008-07-22 14:16:22 +0000
+++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc	2008-07-28 17:08:56 +0000
@@ -7,7 +7,7 @@
 #   since the call of inc/partition_layout_check1.inc                          #
 #   This script is only usefule when sourced within the partitioning tests.    #
 #                                                                              #
-# Attention: The routine inc/partition_layout_check1.inc is very similar       #
+# Attention: The routine inc/partition_layout_check1.inc is very similar   #
 #            to this one. So if something has to be changed here it            #
 #            might be necessary to do it also there                            #
 #                                                                              #
@@ -35,6 +35,7 @@ let $show_file= $MYSQLD_DATADIR/test/tmp
 if ($do_file_tests)
 {
 # List the files belonging to the table t1
+|<<<<<<< TREE
   let $ls_file= $MYSQLD_DATADIR/test/tmp2;
   --list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
   --chmod 0644 $ls_file
@@ -44,6 +45,17 @@ if ($do_file_tests)
     --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
   }
   eval SET @aux = load_file('$ls_file');
+|=======
+let $ls_file= $MYSQLD_DATADIR/test/tmp2;
+let $err_file= $MYSQLD_DATADIR/test/err2;
+--exec ls $MYSQLD_DATADIR/test/t1* > $ls_file 2>$err_file || true
+if ($with_directories)
+{
+--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true
+--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true
+}
+eval SET @aux = load_file('$ls_file');
+|>>>>>>> MERGE-SOURCE
 }
 if (!$do_file_tests)
 {

=== modified file 'mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result'
--- a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result	2008-07-09 11:19:04 +0000
+++ b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result	2008-07-28 17:08:56 +0000
@@ -77,12 +77,21 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
 t1#P#p1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -592,6 +601,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
@@ -604,6 +614,20 @@ t1#P#p4.MYD
 t1#P#p4.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1#P#p2.MYD
+MYSQLD_DATADIR/test/t1#P#p2.MYI
+MYSQLD_DATADIR/test/t1#P#p3.MYD
+MYSQLD_DATADIR/test/t1#P#p3.MYI
+MYSQLD_DATADIR/test/t1#P#p4.MYD
+MYSQLD_DATADIR/test/t1#P#p4.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -1121,6 +1145,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part0.MYD
 t1#P#part0.MYI
 t1#P#part1.MYD
@@ -1139,6 +1164,26 @@ t1#P#part_N.MYD
 t1#P#part_N.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part0.MYD
+MYSQLD_DATADIR/test/t1#P#part0.MYI
+MYSQLD_DATADIR/test/t1#P#part1.MYD
+MYSQLD_DATADIR/test/t1#P#part1.MYI
+MYSQLD_DATADIR/test/t1#P#part2.MYD
+MYSQLD_DATADIR/test/t1#P#part2.MYI
+MYSQLD_DATADIR/test/t1#P#part3.MYD
+MYSQLD_DATADIR/test/t1#P#part3.MYI
+MYSQLD_DATADIR/test/t1#P#part_1.MYD
+MYSQLD_DATADIR/test/t1#P#part_1.MYI
+MYSQLD_DATADIR/test/t1#P#part_2.MYD
+MYSQLD_DATADIR/test/t1#P#part_2.MYI
+MYSQLD_DATADIR/test/t1#P#part_3.MYD
+MYSQLD_DATADIR/test/t1#P#part_3.MYI
+MYSQLD_DATADIR/test/t1#P#part_N.MYD
+MYSQLD_DATADIR/test/t1#P#part_N.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -1654,6 +1699,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta.MYD
 t1#P#parta.MYI
 t1#P#partb.MYD
@@ -1668,6 +1714,22 @@ t1#P#partf.MYD
 t1#P#partf.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta.MYD
+MYSQLD_DATADIR/test/t1#P#parta.MYI
+MYSQLD_DATADIR/test/t1#P#partb.MYD
+MYSQLD_DATADIR/test/t1#P#partb.MYI
+MYSQLD_DATADIR/test/t1#P#partc.MYD
+MYSQLD_DATADIR/test/t1#P#partc.MYI
+MYSQLD_DATADIR/test/t1#P#partd.MYD
+MYSQLD_DATADIR/test/t1#P#partd.MYI
+MYSQLD_DATADIR/test/t1#P#parte.MYD
+MYSQLD_DATADIR/test/t1#P#parte.MYI
+MYSQLD_DATADIR/test/t1#P#partf.MYD
+MYSQLD_DATADIR/test/t1#P#partf.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -2179,6 +2241,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta#SP#partasp0.MYD
 t1#P#parta#SP#partasp0.MYI
 t1#P#parta#SP#partasp1.MYD
@@ -2197,6 +2260,26 @@ t1#P#partd#SP#partdsp1.MYD
 t1#P#partd#SP#partdsp1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYI
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -2712,6 +2795,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#subpart11.MYD
 t1#P#part1#SP#subpart11.MYI
 t1#P#part1#SP#subpart12.MYD
@@ -2730,6 +2814,26 @@ t1#P#part4#SP#subpart42.MYD
 t1#P#part4#SP#subpart42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -3245,6 +3349,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#sp11.MYD
 t1#P#part1#SP#sp11.MYI
 t1#P#part1#SP#sp12.MYD
@@ -3263,6 +3368,26 @@ t1#P#part4#SP#sp42.MYD
 t1#P#part4#SP#sp42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -3776,6 +3901,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#part1sp0.MYD
 t1#P#part1#SP#part1sp0.MYI
 t1#P#part1#SP#part1sp1.MYD
@@ -3796,6 +3922,28 @@ t1#P#part3#SP#part3sp2.MYD
 t1#P#part3#SP#part3sp2.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -4306,12 +4454,21 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
 t1#P#p1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -4821,6 +4978,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
@@ -4833,6 +4991,20 @@ t1#P#p4.MYD
 t1#P#p4.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1#P#p2.MYD
+MYSQLD_DATADIR/test/t1#P#p2.MYI
+MYSQLD_DATADIR/test/t1#P#p3.MYD
+MYSQLD_DATADIR/test/t1#P#p3.MYI
+MYSQLD_DATADIR/test/t1#P#p4.MYD
+MYSQLD_DATADIR/test/t1#P#p4.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -5350,6 +5522,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part0.MYD
 t1#P#part0.MYI
 t1#P#part1.MYD
@@ -5368,6 +5541,26 @@ t1#P#part_N.MYD
 t1#P#part_N.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part0.MYD
+MYSQLD_DATADIR/test/t1#P#part0.MYI
+MYSQLD_DATADIR/test/t1#P#part1.MYD
+MYSQLD_DATADIR/test/t1#P#part1.MYI
+MYSQLD_DATADIR/test/t1#P#part2.MYD
+MYSQLD_DATADIR/test/t1#P#part2.MYI
+MYSQLD_DATADIR/test/t1#P#part3.MYD
+MYSQLD_DATADIR/test/t1#P#part3.MYI
+MYSQLD_DATADIR/test/t1#P#part_1.MYD
+MYSQLD_DATADIR/test/t1#P#part_1.MYI
+MYSQLD_DATADIR/test/t1#P#part_2.MYD
+MYSQLD_DATADIR/test/t1#P#part_2.MYI
+MYSQLD_DATADIR/test/t1#P#part_3.MYD
+MYSQLD_DATADIR/test/t1#P#part_3.MYI
+MYSQLD_DATADIR/test/t1#P#part_N.MYD
+MYSQLD_DATADIR/test/t1#P#part_N.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -5883,6 +6076,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta.MYD
 t1#P#parta.MYI
 t1#P#partb.MYD
@@ -5897,6 +6091,22 @@ t1#P#partf.MYD
 t1#P#partf.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta.MYD
+MYSQLD_DATADIR/test/t1#P#parta.MYI
+MYSQLD_DATADIR/test/t1#P#partb.MYD
+MYSQLD_DATADIR/test/t1#P#partb.MYI
+MYSQLD_DATADIR/test/t1#P#partc.MYD
+MYSQLD_DATADIR/test/t1#P#partc.MYI
+MYSQLD_DATADIR/test/t1#P#partd.MYD
+MYSQLD_DATADIR/test/t1#P#partd.MYI
+MYSQLD_DATADIR/test/t1#P#parte.MYD
+MYSQLD_DATADIR/test/t1#P#parte.MYI
+MYSQLD_DATADIR/test/t1#P#partf.MYD
+MYSQLD_DATADIR/test/t1#P#partf.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -6408,6 +6618,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta#SP#partasp0.MYD
 t1#P#parta#SP#partasp0.MYI
 t1#P#parta#SP#partasp1.MYD
@@ -6426,6 +6637,26 @@ t1#P#partd#SP#partdsp1.MYD
 t1#P#partd#SP#partdsp1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYI
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -6941,6 +7172,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#subpart11.MYD
 t1#P#part1#SP#subpart11.MYI
 t1#P#part1#SP#subpart12.MYD
@@ -6959,6 +7191,26 @@ t1#P#part4#SP#subpart42.MYD
 t1#P#part4#SP#subpart42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -7474,6 +7726,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#sp11.MYD
 t1#P#part1#SP#sp11.MYI
 t1#P#part1#SP#sp12.MYD
@@ -7492,6 +7745,26 @@ t1#P#part4#SP#sp42.MYD
 t1#P#part4#SP#sp42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -8005,6 +8278,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#part1sp0.MYD
 t1#P#part1#SP#part1sp0.MYI
 t1#P#part1#SP#part1sp1.MYD
@@ -8025,6 +8299,28 @@ t1#P#part3#SP#part3sp2.MYD
 t1#P#part3#SP#part3sp2.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1

=== modified file 'mysql-test/suite/parts/r/partition_alter1_1_myisam.result'
--- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result	2008-07-09 13:15:11 +0000
+++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result	2008-07-28 17:08:56 +0000
@@ -236,12 +236,21 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
 t1#P#p1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -751,6 +760,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
@@ -763,6 +773,20 @@ t1#P#p4.MYD
 t1#P#p4.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1#P#p2.MYD
+MYSQLD_DATADIR/test/t1#P#p2.MYI
+MYSQLD_DATADIR/test/t1#P#p3.MYD
+MYSQLD_DATADIR/test/t1#P#p3.MYI
+MYSQLD_DATADIR/test/t1#P#p4.MYD
+MYSQLD_DATADIR/test/t1#P#p4.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -1280,6 +1304,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part0.MYD
 t1#P#part0.MYI
 t1#P#part1.MYD
@@ -1298,6 +1323,26 @@ t1#P#part_N.MYD
 t1#P#part_N.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part0.MYD
+MYSQLD_DATADIR/test/t1#P#part0.MYI
+MYSQLD_DATADIR/test/t1#P#part1.MYD
+MYSQLD_DATADIR/test/t1#P#part1.MYI
+MYSQLD_DATADIR/test/t1#P#part2.MYD
+MYSQLD_DATADIR/test/t1#P#part2.MYI
+MYSQLD_DATADIR/test/t1#P#part3.MYD
+MYSQLD_DATADIR/test/t1#P#part3.MYI
+MYSQLD_DATADIR/test/t1#P#part_1.MYD
+MYSQLD_DATADIR/test/t1#P#part_1.MYI
+MYSQLD_DATADIR/test/t1#P#part_2.MYD
+MYSQLD_DATADIR/test/t1#P#part_2.MYI
+MYSQLD_DATADIR/test/t1#P#part_3.MYD
+MYSQLD_DATADIR/test/t1#P#part_3.MYI
+MYSQLD_DATADIR/test/t1#P#part_N.MYD
+MYSQLD_DATADIR/test/t1#P#part_N.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -1813,6 +1858,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta.MYD
 t1#P#parta.MYI
 t1#P#partb.MYD
@@ -1827,6 +1873,22 @@ t1#P#partf.MYD
 t1#P#partf.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta.MYD
+MYSQLD_DATADIR/test/t1#P#parta.MYI
+MYSQLD_DATADIR/test/t1#P#partb.MYD
+MYSQLD_DATADIR/test/t1#P#partb.MYI
+MYSQLD_DATADIR/test/t1#P#partc.MYD
+MYSQLD_DATADIR/test/t1#P#partc.MYI
+MYSQLD_DATADIR/test/t1#P#partd.MYD
+MYSQLD_DATADIR/test/t1#P#partd.MYI
+MYSQLD_DATADIR/test/t1#P#parte.MYD
+MYSQLD_DATADIR/test/t1#P#parte.MYI
+MYSQLD_DATADIR/test/t1#P#partf.MYD
+MYSQLD_DATADIR/test/t1#P#partf.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -2338,6 +2400,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta#SP#partasp0.MYD
 t1#P#parta#SP#partasp0.MYI
 t1#P#parta#SP#partasp1.MYD
@@ -2356,6 +2419,26 @@ t1#P#partd#SP#partdsp1.MYD
 t1#P#partd#SP#partdsp1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYI
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -2873,6 +2956,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#subpart11.MYD
 t1#P#part1#SP#subpart11.MYI
 t1#P#part1#SP#subpart12.MYD
@@ -2891,6 +2975,26 @@ t1#P#part4#SP#subpart42.MYD
 t1#P#part4#SP#subpart42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -3406,6 +3510,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#sp11.MYD
 t1#P#part1#SP#sp11.MYI
 t1#P#part1#SP#sp12.MYD
@@ -3424,6 +3529,26 @@ t1#P#part4#SP#sp42.MYD
 t1#P#part4#SP#sp42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -3937,6 +4062,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#part1sp0.MYD
 t1#P#part1#SP#part1sp0.MYI
 t1#P#part1#SP#part1sp1.MYD
@@ -3957,6 +4083,28 @@ t1#P#part3#SP#part3sp2.MYD
 t1#P#part3#SP#part3sp2.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -4467,12 +4615,21 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
 t1#P#p1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -4982,6 +5139,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
@@ -4994,6 +5152,20 @@ t1#P#p4.MYD
 t1#P#p4.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1#P#p2.MYD
+MYSQLD_DATADIR/test/t1#P#p2.MYI
+MYSQLD_DATADIR/test/t1#P#p3.MYD
+MYSQLD_DATADIR/test/t1#P#p3.MYI
+MYSQLD_DATADIR/test/t1#P#p4.MYD
+MYSQLD_DATADIR/test/t1#P#p4.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -5511,6 +5683,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part0.MYD
 t1#P#part0.MYI
 t1#P#part1.MYD
@@ -5529,6 +5702,26 @@ t1#P#part_N.MYD
 t1#P#part_N.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part0.MYD
+MYSQLD_DATADIR/test/t1#P#part0.MYI
+MYSQLD_DATADIR/test/t1#P#part1.MYD
+MYSQLD_DATADIR/test/t1#P#part1.MYI
+MYSQLD_DATADIR/test/t1#P#part2.MYD
+MYSQLD_DATADIR/test/t1#P#part2.MYI
+MYSQLD_DATADIR/test/t1#P#part3.MYD
+MYSQLD_DATADIR/test/t1#P#part3.MYI
+MYSQLD_DATADIR/test/t1#P#part_1.MYD
+MYSQLD_DATADIR/test/t1#P#part_1.MYI
+MYSQLD_DATADIR/test/t1#P#part_2.MYD
+MYSQLD_DATADIR/test/t1#P#part_2.MYI
+MYSQLD_DATADIR/test/t1#P#part_3.MYD
+MYSQLD_DATADIR/test/t1#P#part_3.MYI
+MYSQLD_DATADIR/test/t1#P#part_N.MYD
+MYSQLD_DATADIR/test/t1#P#part_N.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -6044,6 +6237,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta.MYD
 t1#P#parta.MYI
 t1#P#partb.MYD
@@ -6058,6 +6252,22 @@ t1#P#partf.MYD
 t1#P#partf.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta.MYD
+MYSQLD_DATADIR/test/t1#P#parta.MYI
+MYSQLD_DATADIR/test/t1#P#partb.MYD
+MYSQLD_DATADIR/test/t1#P#partb.MYI
+MYSQLD_DATADIR/test/t1#P#partc.MYD
+MYSQLD_DATADIR/test/t1#P#partc.MYI
+MYSQLD_DATADIR/test/t1#P#partd.MYD
+MYSQLD_DATADIR/test/t1#P#partd.MYI
+MYSQLD_DATADIR/test/t1#P#parte.MYD
+MYSQLD_DATADIR/test/t1#P#parte.MYI
+MYSQLD_DATADIR/test/t1#P#partf.MYD
+MYSQLD_DATADIR/test/t1#P#partf.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -6569,6 +6779,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta#SP#partasp0.MYD
 t1#P#parta#SP#partasp0.MYI
 t1#P#parta#SP#partasp1.MYD
@@ -6587,6 +6798,26 @@ t1#P#partd#SP#partdsp1.MYD
 t1#P#partd#SP#partdsp1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYI
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -7104,6 +7335,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#subpart11.MYD
 t1#P#part1#SP#subpart11.MYI
 t1#P#part1#SP#subpart12.MYD
@@ -7122,6 +7354,26 @@ t1#P#part4#SP#subpart42.MYD
 t1#P#part4#SP#subpart42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -7637,6 +7889,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#sp11.MYD
 t1#P#part1#SP#sp11.MYI
 t1#P#part1#SP#sp12.MYD
@@ -7655,6 +7908,26 @@ t1#P#part4#SP#sp42.MYD
 t1#P#part4#SP#sp42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -8168,6 +8441,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#part1sp0.MYD
 t1#P#part1#SP#part1sp0.MYI
 t1#P#part1#SP#part1sp1.MYD
@@ -8188,6 +8462,28 @@ t1#P#part3#SP#part3sp2.MYD
 t1#P#part3#SP#part3sp2.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1

=== modified file 'mysql-test/suite/parts/r/partition_alter1_2_myisam.result'
--- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result	2008-07-09 13:15:11 +0000
+++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result	2008-07-28 17:08:56 +0000
@@ -74,12 +74,21 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
 t1#P#p1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -537,6 +546,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
@@ -549,6 +559,20 @@ t1#P#p4.MYD
 t1#P#p4.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1#P#p2.MYD
+MYSQLD_DATADIR/test/t1#P#p2.MYI
+MYSQLD_DATADIR/test/t1#P#p3.MYD
+MYSQLD_DATADIR/test/t1#P#p3.MYI
+MYSQLD_DATADIR/test/t1#P#p4.MYD
+MYSQLD_DATADIR/test/t1#P#p4.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -1014,6 +1038,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part0.MYD
 t1#P#part0.MYI
 t1#P#part1.MYD
@@ -1032,6 +1057,26 @@ t1#P#part_N.MYD
 t1#P#part_N.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part0.MYD
+MYSQLD_DATADIR/test/t1#P#part0.MYI
+MYSQLD_DATADIR/test/t1#P#part1.MYD
+MYSQLD_DATADIR/test/t1#P#part1.MYI
+MYSQLD_DATADIR/test/t1#P#part2.MYD
+MYSQLD_DATADIR/test/t1#P#part2.MYI
+MYSQLD_DATADIR/test/t1#P#part3.MYD
+MYSQLD_DATADIR/test/t1#P#part3.MYI
+MYSQLD_DATADIR/test/t1#P#part_1.MYD
+MYSQLD_DATADIR/test/t1#P#part_1.MYI
+MYSQLD_DATADIR/test/t1#P#part_2.MYD
+MYSQLD_DATADIR/test/t1#P#part_2.MYI
+MYSQLD_DATADIR/test/t1#P#part_3.MYD
+MYSQLD_DATADIR/test/t1#P#part_3.MYI
+MYSQLD_DATADIR/test/t1#P#part_N.MYD
+MYSQLD_DATADIR/test/t1#P#part_N.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -1495,6 +1540,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta.MYD
 t1#P#parta.MYI
 t1#P#partb.MYD
@@ -1509,6 +1555,22 @@ t1#P#partf.MYD
 t1#P#partf.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta.MYD
+MYSQLD_DATADIR/test/t1#P#parta.MYI
+MYSQLD_DATADIR/test/t1#P#partb.MYD
+MYSQLD_DATADIR/test/t1#P#partb.MYI
+MYSQLD_DATADIR/test/t1#P#partc.MYD
+MYSQLD_DATADIR/test/t1#P#partc.MYI
+MYSQLD_DATADIR/test/t1#P#partd.MYD
+MYSQLD_DATADIR/test/t1#P#partd.MYI
+MYSQLD_DATADIR/test/t1#P#parte.MYD
+MYSQLD_DATADIR/test/t1#P#parte.MYI
+MYSQLD_DATADIR/test/t1#P#partf.MYD
+MYSQLD_DATADIR/test/t1#P#partf.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -1968,6 +2030,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#parta#SP#partasp0.MYD
 t1#P#parta#SP#partasp0.MYI
 t1#P#parta#SP#partasp1.MYD
@@ -1986,6 +2049,26 @@ t1#P#partd#SP#partdsp1.MYD
 t1#P#partd#SP#partdsp1.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYI
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -2451,6 +2534,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#subpart11.MYD
 t1#P#part1#SP#subpart11.MYI
 t1#P#part1#SP#subpart12.MYD
@@ -2469,6 +2553,26 @@ t1#P#part4#SP#subpart42.MYD
 t1#P#part4#SP#subpart42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -2932,6 +3036,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#sp11.MYD
 t1#P#part1#SP#sp11.MYI
 t1#P#part1#SP#sp12.MYD
@@ -2950,6 +3055,26 @@ t1#P#part4#SP#sp42.MYD
 t1#P#part4#SP#sp42.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -3411,6 +3536,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#part1#SP#part1sp0.MYD
 t1#P#part1#SP#part1sp0.MYI
 t1#P#part1#SP#part1sp1.MYD
@@ -3431,6 +3557,28 @@ t1#P#part3#SP#part3sp2.MYD
 t1#P#part3#SP#part3sp2.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+|>>>>>>> MERGE-SOURCE
 
 # check prerequisites-1 success:    1
 # check COUNT(*) success:    1
@@ -3893,6 +4041,7 @@ t1	CREATE TABLE `t1` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2  */
 
 unified filelist
+|<<<<<<< TREE
 t1#P#p0.MYD
 t1#P#p0.MYI
 t1#P#p1.MYD
@@ -14874,6 +15023,10989 @@ t1#P#part3#SP#part3sp2.MYD
 t1#P#part3#SP#part3sp2.MYI
 t1.frm
 t1.par
+|=======
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+	
+# check single-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = '#2147483647##';
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
+)
+PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5  */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1#P#p2.MYD
+MYSQLD_DATADIR/test/t1#P#p2.MYI
+MYSQLD_DATADIR/test/t1#P#p3.MYD
+MYSQLD_DATADIR/test/t1#P#p3.MYI
+MYSQLD_DATADIR/test/t1#P#p4.MYD
+MYSQLD_DATADIR/test/t1#P#p4.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+	
+# check single-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = '#2147483647##';
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
+)
+PARTITION BY LIST(MOD(f_int1 + f_int2,4))
+(PARTITION part_3 VALUES IN (-3),
+PARTITION part_2 VALUES IN (-2),
+PARTITION part_1 VALUES IN (-1),
+PARTITION part_N VALUES IN (NULL),
+PARTITION part0 VALUES IN (0),
+PARTITION part1 VALUES IN (1),
+PARTITION part2 VALUES IN (2),
+PARTITION part3 VALUES IN (3));
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#part0.MYD
+MYSQLD_DATADIR/test/t1#P#part0.MYI
+MYSQLD_DATADIR/test/t1#P#part1.MYD
+MYSQLD_DATADIR/test/t1#P#part1.MYI
+MYSQLD_DATADIR/test/t1#P#part2.MYD
+MYSQLD_DATADIR/test/t1#P#part2.MYI
+MYSQLD_DATADIR/test/t1#P#part3.MYD
+MYSQLD_DATADIR/test/t1#P#part3.MYI
+MYSQLD_DATADIR/test/t1#P#part_1.MYD
+MYSQLD_DATADIR/test/t1#P#part_1.MYI
+MYSQLD_DATADIR/test/t1#P#part_2.MYD
+MYSQLD_DATADIR/test/t1#P#part_2.MYI
+MYSQLD_DATADIR/test/t1#P#part_3.MYD
+MYSQLD_DATADIR/test/t1#P#part_3.MYI
+MYSQLD_DATADIR/test/t1#P#part_N.MYD
+MYSQLD_DATADIR/test/t1#P#part_N.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+	
+# check single-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = '#2147483647##';
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
+)
+PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
+(PARTITION parta VALUES LESS THAN (0),
+PARTITION partb VALUES LESS THAN (5),
+PARTITION partc VALUES LESS THAN (10),
+PARTITION partd VALUES LESS THAN (10 + 5),
+PARTITION parte VALUES LESS THAN (20),
+PARTITION partf VALUES LESS THAN (2147483646));
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#parta.MYD
+MYSQLD_DATADIR/test/t1#P#parta.MYI
+MYSQLD_DATADIR/test/t1#P#partb.MYD
+MYSQLD_DATADIR/test/t1#P#partb.MYI
+MYSQLD_DATADIR/test/t1#P#partc.MYD
+MYSQLD_DATADIR/test/t1#P#partc.MYI
+MYSQLD_DATADIR/test/t1#P#partd.MYD
+MYSQLD_DATADIR/test/t1#P#partd.MYI
+MYSQLD_DATADIR/test/t1#P#parte.MYD
+MYSQLD_DATADIR/test/t1#P#parte.MYI
+MYSQLD_DATADIR/test/t1#P#partf.MYD
+MYSQLD_DATADIR/test/t1#P#partf.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+ERROR HY000: Table has no partition for value 2147483647
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
+(PARTITION parta VALUES LESS THAN (0),
+PARTITION partb VALUES LESS THAN (5),
+PARTITION partc VALUES LESS THAN (10),
+PARTITION partd VALUES LESS THAN (2147483646));
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp0.MYI
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYD
+MYSQLD_DATADIR/test/t1#P#parta#SP#partasp1.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partb#SP#partbsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partc#SP#partcsp1.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp0.MYI
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYD
+MYSQLD_DATADIR/test/t1#P#partd#SP#partdsp1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+ERROR HY000: Table has no partition for value 2147483647
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
+)
+PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
+(PARTITION part1 VALUES LESS THAN (0)
+(SUBPARTITION subpart11, SUBPARTITION subpart12),
+PARTITION part2 VALUES LESS THAN (5)
+(SUBPARTITION subpart21, SUBPARTITION subpart22),
+PARTITION part3 VALUES LESS THAN (10)
+(SUBPARTITION subpart31, SUBPARTITION subpart32),
+PARTITION part4 VALUES LESS THAN (2147483646)
+(SUBPARTITION subpart41, SUBPARTITION subpart42));
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#subpart12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#subpart22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#subpart32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#subpart42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+ERROR HY000: Table has no partition for value 2147483647
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1)
+(PARTITION part1 VALUES IN (0)
+(SUBPARTITION sp11, SUBPARTITION sp12),
+PARTITION part2 VALUES IN (1)
+(SUBPARTITION sp21, SUBPARTITION sp22),
+PARTITION part3 VALUES IN (2)
+(SUBPARTITION sp31, SUBPARTITION sp32),
+PARTITION part4 VALUES IN (NULL)
+(SUBPARTITION sp41, SUBPARTITION sp42));
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp11.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#sp12.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp21.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#sp22.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp31.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#sp32.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp41.MYI
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYD
+MYSQLD_DATADIR/test/t1#P#part4#SP#sp42.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+	
+# check single-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = '#2147483647##';
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int1,f_int2)
+)
+PARTITION BY LIST(ABS(MOD(f_int1,2)))
+SUBPARTITION BY KEY(f_int2)  SUBPARTITIONS 3
+(PARTITION part1 VALUES IN (0),
+ PARTITION part2 VALUES IN (1),
+ PARTITION part3 VALUES IN (NULL));
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part1#SP#part1sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part2#SP#part2sp2.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp0.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp1.MYI
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYD
+MYSQLD_DATADIR/test/t1#P#part3#SP#part3sp2.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+	
+# check single-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = '#2147483647##';
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-1 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+	
+# check trigger-2 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-3 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-4 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-5 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+UPDATE t0_aux SET f_int1 =  - f_int1, f_int2 = - f_int2
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-6 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-7 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = - old.f_int1;
+END|
+DELETE FROM t0_aux
+WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
+	
+# check trigger-8 success: 	1
+DROP TRIGGER trg_1;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = 'just inserted'
+   WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
+DELETE FROM t0_aux
+WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = old.f_int1 + @max_row,
+new.f_int2 = old.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-9 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = new.f_int1 + @max_row,
+new.f_int2 = new.f_int2 - @max_row,
+new.f_charbig = '####updated per update trigger####';
+END|
+UPDATE t1
+SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
+f_charbig = '####updated per update statement itself####';
+	
+# check trigger-10 success: 	1
+DROP TRIGGER trg_2;
+UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
+f_int2 = CAST(f_char1 AS SIGNED INT),
+f_charbig = CONCAT('===',f_char1,'===');
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-11 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+SET new.f_int1 = @my_max1 + @counter,
+new.f_int2 = @my_min2 - @counter,
+new.f_charbig = '####updated per insert trigger####';
+SET @counter = @counter + 1;
+END|
+SET @counter = 1;
+SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
+INSERT INTO t1 (f_char1, f_char2, f_charbig)
+SELECT CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
+ORDER BY f_int1;
+DROP TRIGGER trg_3;
+	
+# check trigger-12 success: 	1
+DELETE FROM t1
+WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
+AND f_int2 <> CAST(f_char1 AS SIGNED INT)
+AND f_charbig = '####updated per insert trigger####';
+ANALYZE  TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	note	The storage engine for the table doesn't support analyze
+CHECK    TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	check	note	The storage engine for the table doesn't support check
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	<some_value>
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	The storage engine for the table doesn't support optimize
+# check layout success:    1
+REPAIR   TABLE t1 EXTENDED;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	note	The storage engine for the table doesn't support repair
+# check layout success:    1
+TRUNCATE t1;
+	
+# check TRUNCATE success: 	1
+# check layout success:    1
+# End usability test (inc/partition_check.inc)
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+f_int1 INTEGER,
+f_int2 INTEGER,
+f_char1 CHAR(20),
+f_char2 CHAR(20),
+f_charbig VARCHAR(1000)
+, UNIQUE INDEX uidx1 (f_int2,f_int1)
+)
+PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
+ALTER TABLE t1 DROP INDEX uidx1;
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
+# Start usability test (inc/partition_check.inc)
+create_command
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f_int1` int(11) DEFAULT NULL,
+  `f_int2` int(11) DEFAULT NULL,
+  `f_char1` char(20) DEFAULT NULL,
+  `f_char2` char(20) DEFAULT NULL,
+  `f_charbig` varchar(1000) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2  */
+
+unified filelist
+MYSQLD_DATADIR/test/t1#P#p0.MYD
+MYSQLD_DATADIR/test/t1#P#p0.MYI
+MYSQLD_DATADIR/test/t1#P#p1.MYD
+MYSQLD_DATADIR/test/t1#P#p1.MYI
+MYSQLD_DATADIR/test/t1.frm
+MYSQLD_DATADIR/test/t1.par
+
+# check prerequisites-1 success:    1
+# check COUNT(*) success:    1
+# check MIN/MAX(f_int1) success:    1
+# check MIN/MAX(f_int2) success:    1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
+CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
+WHERE f_int1 IN (2,3);
+# check prerequisites-3 success:    1
+DELETE FROM t1 WHERE f_charbig = 'delete me';
+# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
+# check read via f_int1 success: 1
+# check read via f_int2 success: 1
+	
+# check multiple-1 success: 	1
+DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-2 success: 	1
+INSERT INTO t1 SELECT * FROM t0_template
+WHERE MOD(f_int1,3) = 0;
+	
+# check multiple-3 success: 	1
+UPDATE t1 SET f_int1 = f_int1 + @max_row
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
+AND @max_row_div2 + @max_row_div4;
+	
+# check multiple-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
+AND @max_row_div2 + @max_row_div4 + @max_row;
+	
+# check multiple-5 success: 	1
+SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-1 success: 	1
+SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
+INSERT INTO t1
+SET f_int1 = @cur_value , f_int2 = @cur_value,
+f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
+f_charbig = '#SINGLE#';
+	
+# check single-2 success: 	1
+SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
+SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value2
+WHERE  f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
+	
+# check single-3 success: 	1
+SET @cur_value1= -1;
+SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
+UPDATE t1 SET f_int1 = @cur_value1
+WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
+	
+# check single-4 success: 	1
+SELECT MAX(f_int1) INTO @cur_value FROM t1;
+DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
+	
+# check single-5 success: 	1
+DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
+	
+# check single-6 success: 	1
+INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
+	
+# check single-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = '#2147483647##';
+DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
+INSERT t1 SET f_int1 = 0 , f_int2 = 0,
+f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
+f_charbig = '#NULL#';
+INSERT INTO t1
+SET f_int1 = NULL , f_int2 = -@max_row,
+f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
+f_charbig = '#NULL#';
+# check null success:    1
+	
+# check null-1 success: 	1
+UPDATE t1 SET f_int1 = -@max_row
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-2 success: 	1
+UPDATE t1 SET f_int1 = NULL
+WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-3 success: 	1
+DELETE FROM t1
+WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
+AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
+	
+# check null-4 success: 	1
+DELETE FROM t1
+WHERE f_int1 = 0 AND f_int2 = 0
+AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
+AND f_charbig = '#NULL#';
+SET AUTOCOMMIT= 0;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-1 success: 	1
+COMMIT WORK;
+	
+# check transactions-2 success: 	1
+ROLLBACK WORK;
+	
+# check transactions-3 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+ROLLBACK WORK;
+	
+# check transactions-4 success: 	1
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT f_int1, f_int1, '', '', 'was inserted'
+FROM t0_template source_tab
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+	
+# check transactions-5 success: 	1
+ROLLBACK WORK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+	
+# check transactions-6 success: 	1
+# INFO: Storage engine used for t1 seems to be not transactional.
+COMMIT;
+	
+# check transactions-7 success: 	1
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+SET @@session.sql_mode = 'traditional';
+SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
+INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
+SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
+'', '', 'was inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
+ERROR 22012: Division by 0
+COMMIT;
+	
+# check transactions-8 success: 	1
+# INFO: Storage engine used for t1 seems to be unable to revert
+#       changes made by the failing statement.
+SET @@session.sql_mode = '';
+SET AUTOCOMMIT= 1;
+DELETE FROM t1 WHERE f_charbig = 'was inserted';
+COMMIT WORK;
+UPDATE t1 SET f_charbig = REPEAT('b', 1000);
+	
+# check special-1 success: 	1
+UPDATE t1 SET f_charbig = '';
+	
+# check special-2 success: 	1
+UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
+INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
+'just inserted' FROM t0_template
+WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
+CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
+BEGIN
+UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
+f_charbig = 'updated by trigger'
+      WHERE f_int1 = new.f_int1;
+END|
+INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
+SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
+W